/* ============================================================================
   phone-compact.css - saves space on a phone held upright, so the workspace
   (the canvas) gets as much room as possible. Nothing here changes the
   computer layout.
   File: game/static/game/css/phone-compact.css   (load it AFTER style.css and recipes.css)

   HOW TO EDIT
   1. Section 1: the dictionary panel. On a phone its title, the Dictionary|Recipes
      switch and the close button share ONE row, and the pronunciation buttons and the
      English|Persian tabs share ANOTHER row. (Normally each is a row of its own.)
   2. Section 2: smaller spacing inside the dictionary text and recipes.
   3. Section 3: the elements list and top bar.
   4. Section 4: the Dictionary drop box on the workspace.
   Smaller numbers = less space. Remove a rule to get the old spacing back.
   ============================================================================ */

@media (max-width: 720px) and (orientation: portrait) {

  /* ---------- 1. THE DICTIONARY PANEL'S TOP ROWS ---------- */
  #dict-panel.open {
    display: grid;
    grid-template-columns: minmax(60px, max-content) minmax(0, 1fr) auto;
    align-content: start;
  }
  #dict-panel .dict-header { display: contents; }        /* title and close become grid items */

  /* row 1: title | Dictionary-Recipes switch | close */
  #dict-panel .dict-title {
    grid-area: 1 / 1;
    padding: 4px 0 4px 10px;
    gap: 5px;
    font-size: 15px;
    min-width: 0;
  }
  #dict-panel .dict-title .emoji { font-size: 18px; }
  #dict-panel .dict-title span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  #dict-panel .dict-switch { grid-area: 1 / 2; padding: 4px 4px; gap: 4px; }
  #dict-panel .dict-switch-btn { padding: 3px 6px; font-size: 12.5px; }
  #dict-panel .dict-close { grid-area: 1 / 3; align-self: center; margin-right: 4px; padding: 2px 8px; }

  /* row 2: pronunciation | English-Persian tabs */
  #dict-panel .dict-pron { grid-area: 2 / 1; padding: 0 0 4px 10px; border-bottom: 0; gap: 6px; }
  #dict-panel .dict-pron-label { display: none; }
  #dict-panel .dict-audio-btn { padding: 3px 9px; font-size: 12.5px; gap: 4px; }
  #dict-panel .dict-audio-btn svg { width: 14px; height: 14px; }
  #dict-panel .dict-tabs { grid-area: 2 / 2 / auto / 4; margin: 0 8px 4px 4px; }
  #dict-panel .dict-tab { padding: 3px 8px; font-size: 12.5px; }

  /* row 3: the text */
  #dict-panel .dict-body {
    grid-row: 3;
    grid-column: 1 / -1;
    padding: 6px 12px 10px;
    border-top: 1px solid var(--sidebar-border);
  }


  /* ---------- 2. TEXT AND RECIPES INSIDE THE DICTIONARY ---------- */
  .dict-entry { margin-bottom: 8px; }
  .dict-headword { font-size: 15.5px; }
  .dict-senses { margin-top: 3px; padding: 0 20px; }
  .dict-senses > li { margin-bottom: 4px; font-size: 14px; line-height: 1.45; }
  .dict-examples { margin-top: 2px; font-size: 12.5px; }
  .dict-status { margin: 4px 0; }

  #dict-panel .recipe-row { padding: 4px 0; gap: 4px 6px; }
  #dict-panel .recipe-pill { padding: 2px 8px; font-size: 13px; gap: 4px; }
  #dict-panel .recipe-note, #dict-panel .recipe-more { margin: 4px 0; font-size: 12.5px; line-height: 1.5; }


  /* ---------- 3. ELEMENTS LIST AND TOP BAR ---------- */
  #topbar { padding: 4px 10px; }
  #sidebar-search-wrap { padding: 6px 8px; gap: 6px; }
  #sidebar-search { padding: 5px 10px; }
  .sidebar-sort select { padding-top: 5px; padding-bottom: 5px; }
  #sidebar-count { display: none; }                       /* the number of elements: not needed here */
  #sidebar-list { padding: 8px; gap: 6px; }
  .sidebar-item { padding: 3px 10px; }                    /* even padding now there is no dictionary button */
  .sidebar-item .emoji { font-size: 15px; }
  #canvas-hint { bottom: 8px; }


  /* ---------- 4. THE DICTIONARY DROP BOX ---------- */
  .dict-drop { top: 6px; left: 6px; padding: 4px 9px; gap: 5px; border-radius: 10px; }
  .dict-drop img { width: 20px; height: 20px; }
  .dict-drop small { display: none; }
}
