#platform-loading{position:fixed;inset:0;z-index:10000;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;background:#f8f4e9;padding:24px;color:#36533f;text-align:center;font:14px/1.6 Arial,sans-serif}
#platform-loading strong{font:28px/1.4 Georgia,serif}#platform-loading span{max-width:320px;color:#728266}#platform-loading button{min-height:44px;padding:10px 20px;background:#264c43;color:#fff5df;border:0;border-radius:8px}
html.platform-paused *{animation-play-state:paused!important}
.game-panel,.room-scene{-webkit-touch-callout:none}
/* Phones: the whole table (box, tray, buttons) fits one screen even with a sticky banner taking part of it. */
@media(max-width:760px) and (orientation:portrait){
 .intro{display:none}
 main{padding-top:10px}
 .workspace{gap:10px}
 /* ~445px of the screen is header, letter, tray and buttons; the box (board ratio 4:3.1, 29px of frame) gets the rest. */
 .box-wrap{max-width:max(250px,calc((100vh - 445px) / .775 + 29px));margin-inline:auto}
 @supports(height:100dvh){.box-wrap{max-width:max(250px,calc((100dvh - 445px) / .775 + 29px))}}
}
/* Desktop and tablets (not phones, whose portrait and landscape layouts live in mobile.css): one screen without page
   scrolling; fit.js sizes the game column and the side columns. */
@media (min-width:761px) and (min-height:521px),(min-width:1001px){
 .intro,footer{display:none}
 main{padding-top:14px}
 .letter-column{padding:8px 6px 6px}
 .letter-column,.room-column{overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin}
 .game-panel{width:100%;justify-self:center;margin-inline:auto}
 /* Tighter chrome so the box gets most of the height. */
 header{height:60px;border-bottom-width:4px}
 .brand-mark{width:34px;height:38px;font-size:30px;line-height:32px}
 .brand small{margin-top:3px}
 .game-heading{margin-bottom:10px}
 .box-wrap{padding-top:20px;padding-bottom:12px}
 .tray-caption{margin:14px 0 8px}
 .game-actions{margin-top:12px}
 .message{min-height:0;margin-top:8px}
 .game-actions{flex-wrap:wrap}
 .game-actions>.tool-button{flex:1 1 0;min-width:0;max-width:150px;padding-inline:8px;white-space:nowrap}
 /* A finished parcel: «Следующее письмо» takes the place of «Назад» and «Подсказка», which have nothing to do then,
    so the row keeps its height and the box does not jump. Without :has() the row simply wraps. */
 .game-actions>.continue-level{flex:2 1 0;max-width:none}
 .game-actions:has(.continue-level:not([hidden]))>:is(#undo,#hint){display:none}
}
@media (min-width:761px) and (min-height:521px),(min-width:1001px){
 @media(max-height:760px){.tray-caption{display:none}.tray{margin-top:12px}}
 /* 761–900px: the letter sits in its own row above the game, so it folds into one line like on phones. */
 @media(min-width:761px) and (max-width:900px){
  .workspace{row-gap:12px}
  .letter-column{gap:14px}
  .letter{padding:0 14px;box-shadow:0 2px 8px #5c564408}
  .letter:before,.letter-top,.letter-column .tip,.letter .signature,.letter .postmark{display:none}
  .letter-toggle{display:flex;align-items:center;gap:10px;min-height:44px;padding:6px 0;width:100%;text-align:left;border:0;background:transparent;font-size:13px;line-height:1.4;cursor:pointer}
  .letter-toggle-icon{font-size:20px;color:#b68d65;flex:0 0 23px}
  .letter-chevron{margin-left:auto;font-size:18px;color:#a08e71;transition:transform .2s}
  .letter-toggle[aria-expanded=true] .letter-chevron{transform:rotate(180deg)}
  /* The opened letter drops down over the game instead of pushing it below the fold. */
  .letter-column{overflow:visible}
  .letter{position:relative}
  .letter-body{display:none}
  .letter-body.is-open{display:flow-root;position:absolute;left:-1px;right:-1px;top:100%;z-index:20;background:#fffcf3;border:1px solid #e9e2ce;border-top:0;border-radius:0 0 9px 9px;padding:4px 14px 14px;box-shadow:0 12px 22px #5c564424}
  .letter-column .text-button{display:inline-flex;flex:0 0 auto;margin:0}
 }
}
/* The album also opens from «Все письма» in the letter column, so its second button is dropped to save height. */
@media(min-width:761px){#journal{display:none}}
