/* DB ARCADE: the LEGACY.EXE games (games.js) in DB/OS amber. Everything is
   scoped to .dbg, the element games.js builds for each DB/OS window. */

.dbg { font-size: 12px; text-align: center; }
.dbg .btn { background: none; border: 1px solid var(--line-hi); color: var(--amber); font: 12px var(--mono); padding: 5px 10px; }
.dbg .btn:hover { border-color: var(--amber); background: rgba(255, 178, 62, .1); }
.dbg .sunken { border: 1px solid var(--line-hi); }

.dbg-menu { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.dbg-mi { background: none; border: 1px solid var(--line-hi); color: var(--amber-dim); font: 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; padding: 4px 9px; }
.dbg-mi:hover { color: var(--amber); border-color: var(--amber); }
.dbg-mi.on { background: var(--amber); color: var(--bg); border-color: var(--amber); }
.dbg-status { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 11px; color: var(--amber-dim); text-align: left; }

.dbg .game-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--amber-dim); margin-bottom: 8px; }
.dbg .game-row strong { font: 20px/1 var(--vt); color: var(--amber-hi); text-shadow: var(--glow); letter-spacing: 0; margin-left: 4px; }
.dbg .game-hint { font-size: 10px; letter-spacing: .06em; color: var(--amber-faint); margin: 8px 0 0; }
.dbg .game-canvas { display: block; margin: 0 auto; touch-action: none; max-width: 100%; box-shadow: 0 0 18px rgba(255, 140, 30, .12); }

/* d-pad for phones (Snake) */
.dbg .dpad { display: none; grid-template-columns: repeat(3, 48px); grid-template-rows: repeat(2, 42px); gap: 6px; justify-content: center; margin-top: 10px; }
.dbg .dpad .btn { padding: 0; font-size: 16px; }
.dbg .dpad .up { grid-column: 2; grid-row: 1; }
.dbg .dpad .left { grid-column: 1; grid-row: 2; }
.dbg .dpad .down { grid-column: 2; grid-row: 2; }
.dbg .dpad .right { grid-column: 3; grid-row: 2; }
@media (hover: none) { .dbg .dpad { display: grid; } }

/* ---- DB ARCADE folder ---- */
.dbg .folder-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; padding: 10px; background: #060504; }
.dbg .folder-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border: 1px solid var(--line); background: none; color: var(--amber); font: 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.dbg .folder-item:hover, .dbg .folder-item:focus-visible { border-color: var(--amber); background: rgba(255, 178, 62, .08); box-shadow: var(--glow); outline: none; }
.dbg .fi-icon { font-size: 28px; line-height: 1; filter: sepia(1) saturate(2.5) hue-rotate(-10deg); }

/* ---- Chadsweeper ---- */
.dbg .ms-top { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; margin-bottom: 8px; background: #060504; }
.dbg .ms-lcd { font: 28px/1 var(--vt); color: var(--hot); text-shadow: 0 0 6px rgba(255, 90, 31, .6); min-width: 46px; text-align: right; letter-spacing: 1px; }
.dbg .btn.ms-face { width: 34px; height: 34px; font-size: 18px; padding: 0; line-height: 1; }
.dbg .ms-grid { display: inline-grid; gap: 1px; background: var(--line); padding: 1px; touch-action: manipulation; }
.dbg .ms-cell {
  width: var(--cell, 24px);
  height: var(--cell, 24px);
  padding: 0;
  margin: 0;
  font: calc(var(--cell, 24px) * .9)/1 var(--vt);
  background: #3a2a15;
  border: 0;
  box-shadow: inset 1px 1px 0 rgba(255, 210, 122, .35), inset -1px -1px 0 rgba(0, 0, 0, .7);
  color: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.dbg .ms-cell:not(.open):hover { background: #4d3819; }
.dbg .ms-cell.open { background: #0a0806; box-shadow: none; cursor: default; }
.dbg .ms-cell.boom { background: var(--hot); }
.dbg .ms-cell.n1 { color: var(--amber-dim); } .dbg .ms-cell.n2 { color: var(--amber); } .dbg .ms-cell.n3 { color: var(--amber-hi); }
.dbg .ms-cell.n4, .dbg .ms-cell.n5, .dbg .ms-cell.n6, .dbg .ms-cell.n7, .dbg .ms-cell.n8 { color: var(--hot); }
.dbg .ms-flagmode { margin-top: 8px; font-size: 11px; }
.dbg .ms-flagmode[aria-pressed='true'] { background: var(--amber); color: var(--bg); }

/* ---- 2048 David Edition: tiles climb from dim amber to white-hot ---- */
.dbg .g48-board { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); gap: 6px; padding: 6px; background: #060504; width: min(300px, 100%); margin: 0 auto; aspect-ratio: 1; touch-action: none; }
.dbg .g48-cell { min-width: 0; min-height: 0; background: #15100a; border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--amber); overflow: hidden; }
.dbg .g48-cell .v { font: clamp(20px, 7vw, 30px)/1 var(--vt); }
.dbg .g48-cell .r { font-size: 7px; margin-top: 2px; text-transform: uppercase; letter-spacing: .1em; opacity: .85; }
.dbg .g48-cell.pop { animation: dbgpop .16s ease-out; }
.dbg .g48-cell.new { animation: dbgnew .18s ease-out; }
@keyframes dbgpop { 50% { transform: scale(1.12); } }
@keyframes dbgnew { 0% { transform: scale(.3); opacity: .2; } }
.dbg .t2 { background: #241a0f; color: var(--amber-dim); } .dbg .t4 { background: #33240f; color: var(--amber-dim); }
.dbg .t8 { background: #4a3210; } .dbg .t16 { background: #634213; }
.dbg .t32 { background: #855816; color: var(--amber-hi); } .dbg .t64 { background: #a8742a; color: #1a1209; }
.dbg .t128 { background: #c98a2e; color: #1a1209; } .dbg .t256 { background: #ffb23e; color: #1a1209; }
.dbg .t512 { background: #ffc35a; color: #1a1209; box-shadow: var(--glow); } .dbg .t1024 { background: #ffd27a; color: #1a1209; box-shadow: var(--glow); }
.dbg .t2048 { background: var(--hot); color: #1a1209; box-shadow: 0 0 18px rgba(255, 90, 31, .8); }
.dbg .tbig { background: #ffe2a6; color: #1a1209; box-shadow: 0 0 22px rgba(255, 178, 62, .9); }
.dbg .g48-over { position: absolute; inset: 0; background: rgba(10, 8, 6, .88); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font: 13px var(--pix); letter-spacing: .08em; color: var(--amber); text-shadow: var(--glow); }

/* ---- DB Tank phone controls ---- */
.dbg .tank-pad { display: none; align-items: center; justify-content: center; gap: 18px; margin-top: 10px; touch-action: none; -webkit-user-select: none; user-select: none; }
.dbg .tank-pad .dpad { margin-top: 0; }
.dbg .tank-fire { width: 78px; height: 78px; border-radius: 50%; border-color: var(--amber); font: 13px var(--pix); color: var(--amber-hi); text-shadow: var(--glow); }
.dbg .tank-fire:active { background: var(--amber); color: var(--bg); }
@media (hover: none) { .dbg .tank-pad { display: flex; } }
