/* Full-screen play layout (desktop, tablet, non-touch): the arena owns the screen, the HUD
   floats on top and the old side panel becomes a drawer that only opens on request.
   Phones keep their dedicated touch layout (body.mobile-game). */
body:not(.mobile-game) { overflow: hidden; background: #120d2a; }
body:not(.mobile-game) main { max-width: none; padding: 0; margin: 0; height: 100dvh; }
body:not(.mobile-game) main > header { position: fixed; top: 12px; right: 16px; z-index: 30; margin: 0; display: flex; gap: 8px; pointer-events: none; }
body:not(.mobile-game) main > header > * { pointer-events: auto; }
body:not(.mobile-game) main > header .brand, body:not(.mobile-game) main > header .edition, body:not(.mobile-game) main > header .tagline,
body:not(.mobile-game) main > header > p, body:not(.mobile-game) main > header > a { display: none; }
body:not(.mobile-game) main > header .header-side { display: flex; align-items: center; gap: 8px; }
body:not(.mobile-game) main > header button { width: auto; margin: 0; min-height: 40px; padding: 8px 14px; border-radius: 14px; border: 3px solid #fff; background: rgba(20, 16, 44, .82); color: #fff; font-weight: 800; font-size: 13px; box-shadow: 0 4px 0 rgba(0,0,0,.35); }
body:not(.mobile-game) #status { position: fixed; left: 16px; bottom: 16px; z-index: 25; max-width: 40vw; padding: 6px 12px; border-radius: 12px; background: rgba(20, 16, 44, .7); color: #fff; font-size: 12px; font-weight: 700; pointer-events: none; }
body:not(.mobile-game) #status:empty { display: none; }
body:not(.mobile-game) .layout { display: block; position: fixed; inset: 0; }
body:not(.mobile-game) .stage { position: absolute; inset: 0; max-width: none; width: auto; height: auto; margin: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; overflow: hidden; }
body:not(.mobile-game) .board-wrap, body:not(.mobile-game) .canvas-wrap { position: absolute; inset: 0; background: transparent; }
body:not(.mobile-game) .stage canvas#game { width: 100%; height: 100%; aspect-ratio: auto; }
body:not(.mobile-game) .stage-footer, body:not(.mobile-game) .understage, body:not(.mobile-game) main > footer { display: none; }

/* the side panel as an on-demand drawer */
body:not(.mobile-game) aside#game-menu { position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: min(400px, 94vw); max-height: none; border-radius: 26px 0 0 26px; border: 3px solid #fff; border-right: 0;
  background: rgba(24, 19, 52, .96); color: #fff; transform: translateX(105%); transition: transform .28s cubic-bezier(.2, 1.2, .4, 1); box-shadow: -18px 0 40px rgba(0,0,0,.45); overflow-y: auto; }
body:not(.mobile-game).drawer-open aside#game-menu { transform: none; }
body:not(.mobile-game) .drawer-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(8, 6, 20, .45); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .2s; }
body:not(.mobile-game).drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
body.mobile-game .drawer-backdrop, body.mobile-game .drawer-close { display: none; }
body:not(.mobile-game) aside#game-menu nav { background: rgba(24, 19, 52, .98); padding-right: 52px; }
body:not(.mobile-game) aside#game-menu nav button.active { color: #ffd34d; box-shadow: inset 0 -3px #ffd34d; }
body:not(.mobile-game) aside#game-menu section { padding: 18px 20px; }
body:not(.mobile-game) aside#game-menu select, body:not(.mobile-game) aside#game-menu input:not([type=checkbox]):not([type=range]) { background: rgba(0,0,0,.35); color: #fff; border: 2px solid rgba(255,255,255,.35); border-radius: 12px; min-height: 42px; font-weight: 700; }
body:not(.mobile-game) aside#game-menu section button:not(.secondary):not(.subtle):not([data-tab]) { background: #ff5dba; color: #1a1030; border: 3px solid #fff; border-radius: 14px; font-weight: 900; font-size: 15px; min-height: 46px; box-shadow: 0 5px 0 rgba(0,0,0,.35); }
body:not(.mobile-game) aside#game-menu button.secondary { border-radius: 12px; }
.drawer-close { position: fixed; z-index: 41; top: 10px; right: 12px; width: 40px !important; height: 40px; min-height: 0 !important; margin: 0 !important; padding: 0 !important; border-radius: 50% !important; border: 3px solid #fff !important; background: #1a1030 !important; color: #fff !important; font-size: 18px !important; font-weight: 900; transform: translateX(450px); transition: transform .28s; }
body.drawer-open .drawer-close { transform: none; }

dialog { border: 3px solid #fff !important; border-radius: 24px !important; background: rgba(24, 19, 52, .97) !important; color: #fff !important; box-shadow: 0 10px 0 rgba(0,0,0,.35), 0 30px 80px rgba(0,0,0,.5) !important; }
dialog::backdrop { background: rgba(8, 6, 20, .55); backdrop-filter: blur(3px); }

body.drawer-open:not(.mobile-game) main > header { display: none; }

/* Tetris HUD extras */
body:not(.mobile-game) main > header .brand-icon { display: none; }
body:not(.mobile-game) .target-bar { position: absolute; z-index: 10; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 6px; padding: 6px; border-radius: 16px; background: rgba(22, 18, 58, .82); border: 2px solid rgba(255,255,255,.6); }
body:not(.mobile-game) .target-bar button { width: auto; margin: 0; padding: 6px 12px; border-radius: 10px; border: 2px solid transparent; background: transparent; color: #cfd8ff; font-weight: 800; font-size: 12px; }
body:not(.mobile-game) .target-bar button[aria-pressed=true] { background: #ff5dba; color: #1a1030; border-color: #fff; }
body:not(.mobile-game) #paused-shade { position: absolute; inset: 0; z-index: 12; display: grid; place-items: center; background: rgba(8, 6, 26, .55); backdrop-filter: blur(3px); }
body:not(.mobile-game) #paused-shade[hidden] { display: none; }

/* phones already have a panel "Menu" button: the arcade main menu becomes a home icon */
body.mobile-game #arcade-menu { font-size: 0 !important; min-width: 44px; }
body.mobile-game #arcade-menu::before { content: "\2302"; font-size: 20px; }
