/* ============================================================
   kocik's arcade — theme
   ============================================================ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: #eaf0ff;
  background:
    radial-gradient(1000px 500px at 15% -10%, rgba(255, 255, 255, 0.18), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(255, 255, 255, 0.14), transparent 60%),
    linear-gradient(160deg, #1f1f1f 0%, #343434 55%, #262626 100%);
  background-attachment: fixed;
}

button { font-family: inherit; }

/* ---------- header ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(26, 26, 26, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.topbar-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.logo {
  margin: 0;
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #fff;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.9),
    0 0 24px rgba(255, 255, 255, 0.55),
    0 0 48px rgba(255, 255, 255, 0.35);
}
.hud { display: flex; align-items: center; gap: 10px; }
.points-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid rgba(255, 215, 0, 0.55);
  color: #ffe27a;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 15px;
}
.coin { font-size: 16px; }
.lang-toggle {
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  overflow: hidden;
}
.lang-btn {
  border: 0;
  background: transparent;
  color: #c7c7c7;
  font-weight: 700;
  font-size: 13px;
  padding: 7px 14px;
  cursor: pointer;
}
.lang-btn.active {
  background: linear-gradient(135deg, #ffffff, #ffffff);
  color: #fff;
}

/* golden banner item: cosmetic glow everywhere */
body.golden .logo {
  color: #fff3b0;
  text-shadow:
    0 0 10px rgba(255, 215, 0, 0.95),
    0 0 30px rgba(255, 180, 0, 0.7),
    0 0 60px rgba(255, 140, 0, 0.5);
}
body.golden .topbar { border-bottom-color: rgba(255, 200, 40, 0.75); }
body.golden .logo::before { content: "\2726\2726 "; color: #ffd700; }
body.golden .logo::after  { content: " \2726\2726"; color: #ffd700; }

/* ---------- layout ---------- */
#app {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

/* ---------- menu ---------- */
.menu-note {
  margin: 0 0 14px;
  color: #c9c9c9;
  font-size: 13.5px;
}
.menu {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 14px;
}
.card {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 18px 16px;
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: block;
  width: 100%;
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.15);
}
.card .icon { font-size: 34px; display: block; margin-bottom: 8px; }
.card .c-name { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.card .c-desc { font-size: 13px; color: #c9c9c9; line-height: 1.35; }

/* ---------- game panel ---------- */
.game-panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 20px;
}
.back-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #e6e6e6;
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 12px;
}
.back-btn:hover { border-color: #ffffff; color: #fff; }
.game-title {
  font-size: 24px;
  margin: 4px 0 16px;
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.5);
}
.game-body { display: flex; flex-direction: column; gap: 14px; }
.hint { color: #c9c9c9; font-size: 14px; margin: 4px 0; }
.big { font-size: 20px; font-weight: 700; }

/* ---------- buttons & inputs ---------- */
.btn {
  background: linear-gradient(135deg, #ffffff, #ffffff);
  border: 0;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  border-radius: 10px;
  padding: 10px 18px;
  cursor: pointer;
  transition: filter 0.12s ease, transform 0.12s ease;
}
.btn:hover { filter: brightness(1.15); transform: translateY(-1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.alt { background: linear-gradient(135deg, #d4d4d4, #ffffff); }
.btn.gold { background: linear-gradient(135deg, #ffd700, #ff9d00); color: #332600; }
.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #f2f2f2;
}
.btn.ghost:hover { border-color: #ffffff; color: #fff; }
.btn.small { font-size: 13px; padding: 7px 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.num-input, .text-input {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
  width: 150px;
  outline: none;
}
.num-input:focus, .text-input:focus { border-color: #ffffff; }

/* difficulty buttons */
.diff-row { display: flex; gap: 10px; flex-wrap: wrap; }
.diff-btn {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  flex: 1 1 140px;
  min-width: 140px;
}
.diff-btn:hover { border-color: #ffffff; box-shadow: 0 0 18px rgba(255, 255, 255, 0.25); }
.diff-btn .d-name { font-weight: 700; font-size: 15px; }
.diff-btn .d-sub { font-size: 12.5px; color: #c9c9c9; margin-top: 3px; line-height: 1.3; }

/* message feed */
.feed { display: flex; flex-direction: column; gap: 6px; }
.feed-line {
  background: rgba(0, 0, 0, 0.28);
  border-left: 3px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14.5px;
}
.feed-line.good { border-left-color: #ffffff; color: #ffffff; }
.feed-line.bad { border-left-color: #ff4d6d; color: #ffc4cf; }
.feed-line.gold { border-left-color: #ffd700; color: #ffe9a3; }

/* prize line */
.prize-line {
  font-size: 17px;
  font-weight: 800;
  color: #ffe27a;
  text-shadow: 0 0 14px rgba(255, 215, 0, 0.45);
}

/* ---------- tic-tac-toe ---------- */
.ttt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 330px;
}
.ttt-cell {
  aspect-ratio: 1 / 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  font-size: 38px;
  font-weight: 800;
  color: #c0c0c0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ttt-cell.x { color: #ffffff; text-shadow: 0 0 14px rgba(255, 255, 255, 0.6); }
.ttt-cell.o { color: #ffffff; text-shadow: 0 0 14px rgba(255, 255, 255, 0.6); }

/* ---------- rock paper scissors ---------- */
.rps-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.rps-btn {
  font-size: 46px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 18px;
  padding: 14px 22px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.rps-btn:hover { transform: scale(1.07); border-color: #ffd700; }
.rps-score { font-size: 22px; font-weight: 800; text-align: center; }

/* ---------- hangman ---------- */
.hang-wrap { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.hang-svg { flex: 0 0 150px; }
.hang-side { flex: 1 1 240px; min-width: 230px; }
.hang-word {
  font-family: "Courier New", monospace;
  font-size: 34px;
  letter-spacing: 8px;
  font-weight: 700;
  margin: 8px 0;
  color: #fff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}
.kbd { display: flex; flex-wrap: wrap; gap: 6px; }
.kbd-btn {
  width: 34px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: #e6ebff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.kbd-btn:hover:not(:disabled) { border-color: #ffd700; }
.kbd-btn:disabled { opacity: 0.28; cursor: default; }

/* ---------- memory ---------- */
.mem-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 460px;
}
.mem-tile {
  aspect-ratio: 1 / 1;
  background: linear-gradient(145deg, #474747, #333333);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  font-size: 30px;
  font-weight: 800;
  color: #c0c0c0;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.2s ease, color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mem-tile:hover:not(.up) { border-color: rgba(255, 255, 255, 0.6); }
.mem-tile.up {
  transform: rotateY(180deg);
  color: #ffd700;
  border-color: rgba(255, 215, 0, 0.55);
  background: linear-gradient(145deg, #606060, #4d4d4d);
  cursor: default;
}
.mem-tile.matched { color: #ffffff; border-color: rgba(255, 255, 255, 0.5); cursor: default; }

/* ---------- higher/lower ---------- */
.hilo-cards { display: flex; gap: 16px; justify-content: center; }
.pcard {
  width: 110px;
  height: 150px;
  border-radius: 14px;
  background: #f5f2ff;
  color: #333333;
  border: 3px solid #e8e8e8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}
.pcard.red { color: #d92332; }
.pcard .p-rank { font-size: 44px; line-height: 1; }
.pcard .p-suit { font-size: 30px; }
.hilo-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- math ---------- */
.math-q {
  font-family: "Courier New", monospace;
  font-size: 40px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 4px;
  margin: 6px 0;
}

/* ---------- minesweeper ---------- */
.ms-grid {
  display: grid;
  gap: 4px;
  justify-content: center;
}
.ms-cell {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  border: 0;
  background: linear-gradient(145deg, #636363, #505050);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ms-cell:hover { filter: brightness(1.25); }
.ms-cell.open {
  background: rgba(255, 255, 255, 0.07);
  cursor: default;
}
.ms-cell.n1 { color: #ffffff; }
.ms-cell.n2 { color: #e3e3e3; }
.ms-cell.n3 { color: #ff6b6b; }
.ms-cell.n4 { color: #ffffff; }
.ms-cell.n5 { color: #ffb84d; }
.ms-cell.n6 { color: #e3e3e3; }
.ms-cell.n7 { color: #ffffff; }
.ms-cell.n8 { color: #ffd700; }
.ms-cell.mine { background: #5a1220; }
.ms-cell.hit { background: #ff2946; }
.flag-toggle { border-color: rgba(255, 215, 0, 0.4); }
.flag-toggle.on {
  background: linear-gradient(135deg, #ffd700, #ff9d00);
  color: #332600;
}

/* ---------- blackjack ---------- */
.bj-table { display: flex; flex-direction: column; gap: 10px; }
.bj-row-label { color: #c9c9c9; font-size: 13px; font-weight: 700; letter-spacing: 1px; }
.bj-hand { display: flex; gap: 8px; flex-wrap: wrap; min-height: 74px; }
.bcard {
  width: 62px;
  height: 86px;
  border-radius: 10px;
  background: #f5f2ff;
  border: 2px solid #e8e8e8;
  color: #333333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.bcard.red { color: #d92332; }
.bcard.hole {
  background: repeating-linear-gradient(45deg, #636363, #636363 8px, #515151 8px, #515151 16px);
  color: #c0c0c0;
  border-color: #808080;
}

/* ---------- roulette ---------- */
.rlt-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  max-width: 520px;
}
.rlt-num {
  border: 0;
  border-radius: 8px;
  padding: 9px 0;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  color: #fff;
}
.rlt-num.red { background: #c22a41; }
.rlt-num.black { background: #3d3d3d; }
.rlt-num.green { background: #8a8a8a; }
.rlt-num.sel { outline: 3px solid #ffd700; }
.rlt-display {
  font-size: 46px;
  font-weight: 800;
  text-align: center;
  font-family: "Courier New", monospace;
  min-height: 58px;
  letter-spacing: 3px;
}
.rlt-display.red { color: #ff7389; text-shadow: 0 0 18px rgba(255, 46, 100, 0.6); }
.rlt-display.black { color: #e8e8e8; }
.rlt-display.green { color: #ffffff; text-shadow: 0 0 18px rgba(255, 255, 255, 0.6); }
.rlt-type-row { display: flex; gap: 10px; flex-wrap: wrap; }
.rlt-type {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.3);
  color: #e6ebff;
  font-weight: 700;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 15px;
}
.rlt-type.sel { outline: 3px solid #ffd700; }
.rlt-type.t-red.sel { outline-color: #ff4d6d; }
.rlt-type.t-black.sel { outline-color: #ffffff; }
.rlt-type.t-green.sel { outline-color: #ffffff; }

/* ---------- shop ---------- */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 14px;
}
.item-card {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.item-card .i-icon { font-size: 32px; }
.item-card .i-name { font-weight: 800; font-size: 16px; }
.item-card .i-desc { font-size: 13px; color: #c9c9c9; line-height: 1.4; flex: 1; }
.item-card .i-price { color: #ffe27a; font-weight: 800; }
.item-card.owned { border-color: rgba(255, 255, 255, 0.55); }

/* ---------- toasts ---------- */
#toast-box {
  position: fixed;
  top: 74px;
  right: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: rgba(30, 30, 30, 0.92);
  border: 1px solid rgba(255, 215, 0, 0.6);
  color: #ffe27a;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.25s ease;
  max-width: 300px;
}
.toast.loss { border-color: rgba(255, 77, 109, 0.7); color: #ffc4cf; }
.toast.info { border-color: rgba(255, 255, 255, 0.6); color: #ffffff; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- misc ---------- */
.center { text-align: center; }
.spacer { height: 8px; }
hr.sep { border: 0; border-top: 1px solid rgba(255, 255, 255, 0.12); margin: 14px 0; }

@media (max-width: 560px) {
  .logo { font-size: 20px; }
  .ttt-cell { font-size: 30px; }
  .math-q { font-size: 30px; }
  .mem-grid { max-width: 340px; }
  .pcard { width: 92px; height: 128px; }
  .pcard .p-rank { font-size: 34px; }
}

/* ============================================================
   RETRO CRT / OLD COMPUTER AESTHETIC
   ============================================================ */
@font-face {
  font-family: 'VT323';
  src: url('https://fonts.gstatic.com/s/vt323/v16/pxiByp8kv8JHgFVrLCz7V1d3.woff2') format('woff2');
  font-display: swap;
}

html {
  font-family: "VT323", "Courier New", ui-monospace, monospace;
}

body {
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.03) 2px,
      rgba(255, 255, 255, 0.03) 4px
    ),
    radial-gradient(ellipse at center, #1a1a1a 0%, #000 100%);
  background-attachment: fixed;
}

.topbar {
  background: rgba(20, 20, 20, 0.9);
  border-bottom: 2px solid #444444;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.15);
}

.logo {
  color: #ffffff;
  text-shadow:
    0 0 4px #ffffff,
    0 0 12px #ffffff,
    0 0 24px #ffffff;
  font-family: "VT323", "Courier New", monospace;
  letter-spacing: 3px;
}

.points-pill {
  background: rgba(40, 40, 40, 0.8);
  border: 1px solid #ffffff;
  color: #ffffff;
}

.lang-btn {
  color: #aaaaaa;
  border: 1px solid #444444;
}
.lang-btn.active {
  background: #333333;
  color: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.card {
  background: rgba(30, 30, 30, 0.7);
  border: 1px solid #444444;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.card:hover {
  border-color: #ffffff;
  box-shadow:
    0 0 12px rgba(255, 255, 255, 0.3),
    inset 0 0 20px rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}
.card .c-name { color: #ffffff; text-shadow: 0 0 6px #ffffff; }
.card .c-desc { color: #aaaaaa; }

.game-panel {
  background: rgba(20, 20, 20, 0.85);
  border: 2px solid #444444;
  box-shadow:
    inset 0 0 40px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(255, 255, 255, 0.1);
}

.back-btn {
  color: #ffffff;
  border-color: #444444;
}
.back-btn:hover { border-color: #ffffff; color: #ffffff; box-shadow: 0 0 8px rgba(255, 255, 255, 0.4); }

.game-title {
  color: #ffffff;
  text-shadow: 0 0 8px #ffffff, 0 0 16px #ffffff;
  font-family: "VT323", "Courier New", monospace;
}

.btn {
  background: #222222;
  border: 2px solid #ffffff;
  color: #ffffff;
  text-shadow: 0 0 4px #ffffff;
  font-family: "VT323", "Courier New", monospace;
  letter-spacing: 1px;
}
.btn:hover {
  background: #444444;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.5), inset 0 0 8px rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}
.btn.alt { border-color: #ffffff; color: #ffffff; text-shadow: 0 0 4px #ffffff; }
.btn.alt:hover { background: #444444; box-shadow: 0 0 12px rgba(255, 255, 255, 0.5); }
.btn.gold { border-color: #ffd700; color: #ffd700; text-shadow: 0 0 4px #ffd700; background: #221800; }
.btn.gold:hover { background: #332200; box-shadow: 0 0 12px rgba(255, 215, 0, 0.5); }
.btn.ghost { background: transparent; border-color: #444444; color: #aaaaaa; }
.btn.ghost:hover { border-color: #ffffff; color: #ffffff; }
.btn:disabled { opacity: 0.4; border-color: #555555; color: #555555; }

.diff-btn {
  background: rgba(30, 30, 30, 0.8);
  border: 1px solid #444444;
  color: #ffffff;
}
.diff-btn:hover { border-color: #ffffff; box-shadow: 0 0 12px rgba(255, 255, 255, 0.3); }
.diff-btn .d-name { color: #ffffff; text-shadow: 0 0 4px #ffffff; }
.diff-btn .d-sub { color: #aaaaaa; }

.feed-line {
  background: rgba(20, 20, 20, 0.8);
  border-left: 3px solid #444444;
}
.feed-line.good { border-left-color: #ffffff; color: #ffffff; }
.feed-line.bad { border-left-color: #ff4466; color: #ff8899; }
.feed-line.gold { border-left-color: #ffd700; color: #ffe9a3; }

.prize-line { color: #ffd700; text-shadow: 0 0 10px #ffd700, 0 0 20px #ff8c00; }

/* Tic-tac-toe */
.ttt-cell {
  background: rgba(20, 20, 20, 0.8);
  border: 2px solid #444444;
  color: #aaaaaa;
  font-family: "VT323", "Courier New", monospace;
}
.ttt-cell.x { color: #ffffff; text-shadow: 0 0 8px #ffffff; border-color: #ffffff; }
.ttt-cell.o { color: #ff4466; text-shadow: 0 0 8px #ff4466; border-color: #ff4466; }

/* RPS */
.rps-btn {
  background: rgba(20, 20, 20, 0.8);
  border: 2px solid #444444;
  color: #ffffff;
}
.rps-btn:hover { border-color: #ffffff; box-shadow: 0 0 16px rgba(255, 255, 255, 0.4); }

/* Hangman */
.hang-word { color: #ffffff; text-shadow: 0 0 8px #ffffff; font-family: "VT323", monospace; }
.kbd-btn {
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid #444444;
  color: #ffffff;
}
.kbd-btn:hover:not(:disabled) { border-color: #ffffff; box-shadow: 0 0 8px rgba(255, 255, 255, 0.3); }

/* Memory */
.mem-tile {
  background: rgba(20, 20, 20, 0.8);
  border: 2px solid #444444;
  color: #aaaaaa;
  font-family: "VT323", "Courier New", monospace;
}
.mem-tile.up {
  background: rgba(60, 60, 60, 0.9);
  border-color: #ffffff;
  color: #ffd700;
  text-shadow: 0 0 8px #ffd700;
}
.mem-tile.matched { color: #ffffff; border-color: #ffffff; text-shadow: 0 0 8px #ffffff; }

/* Cards */
.pcard {
  background: #1a1a1a;
  border: 2px solid #444444;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}
.pcard.red { color: #ff4466; }
.pcard .p-rank { font-family: "VT323", "Courier New", monospace; }

/* Math */
.math-q { font-family: "VT323", "Courier New", monospace; color: #ffffff; text-shadow: 0 0 6px #ffffff; }

/* Minesweeper */
.ms-cell {
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid #444444;
  color: #ffffff;
  font-family: "VT323", "Courier New", monospace;
}
.ms-cell.open { background: rgba(40, 40, 40, 0.9); }
.ms-cell.mine { background: #220000; color: #ff4466; }
.ms-cell.hit { background: #440000; color: #ff0000; box-shadow: inset 0 0 10px #ff0000; }
.ms-cell.n1 { color: #ffffff; } .ms-cell.n2 { color: #ffffff; } .ms-cell.n3 { color: #ffd700; }
.ms-cell.n4 { color: #ff4466; } .ms-cell.n5 { color: #ffffff; } .ms-cell.n6 { color: #ffffff; }
.ms-cell.n7 { color: #ff8800; } .ms-cell.n8 { color: #ffffff; }

/* Blackjack */
.bcard { background: #1a1a1a; border: 1px solid #444444; color: #ffffff; font-family: "VT323", monospace; padding: 4px 8px; border-radius: 4px; }
.bcard.red { color: #ff4466; }
.bj-hand { display: flex; gap: 6px; flex-wrap: wrap; }

/* Roulette */
.rlt-type {
  background: rgba(20, 20, 20, 0.8);
  border: 2px solid #444444;
  color: #ffffff;
}
.rlt-type:hover, .rlt-type.sel { border-color: #ffffff; box-shadow: 0 0 12px rgba(255, 255, 255, 0.4); background: rgba(40, 40, 40, 0.9); }
.rlt-type.t-red:hover { border-color: #ff4466; box-shadow: 0 0 12px rgba(255, 68, 102, 0.4); }
.rlt-type.t-black:hover { border-color: #ffffff; box-shadow: 0 0 12px rgba(255, 255, 255, 0.3); }
.rlt-type.t-green:hover { border-color: #ffffff; box-shadow: 0 0 12px rgba(255, 255, 255, 0.4); }
.rlt-type.t-num:hover { border-color: #ffd700; box-shadow: 0 0 12px rgba(255, 215, 0, 0.4); }
.rlt-display { color: #ffffff; text-shadow: 0 0 12px #ffffff; font-family: "VT323", monospace; font-size: 48px; }
.rlt-display.red { color: #ff4466; text-shadow: 0 0 12px #ff4466; }
.rlt-display.black { color: #ffffff; text-shadow: 0 0 12px #ffffff; }
.rlt-display.green { color: #ffffff; text-shadow: 0 0 12px #ffffff; }

.rlt-num {
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid #444444;
  color: #ffffff;
  font-family: "VT323", "Courier New", monospace;
}
.rlt-num.red { color: #ff4466; }
.rlt-num.green { color: #ffffff; }
.rlt-num.sel { border-color: #ffd700; box-shadow: 0 0 8px rgba(255, 215, 0, 0.5); background: rgba(40, 30, 0, 0.9); }

/* Shop */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.item-card {
  background: rgba(20, 20, 20, 0.8);
  border: 2px solid #444444;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.item-card:hover { border-color: #ffffff; box-shadow: 0 0 16px rgba(255, 255, 255, 0.2); }
.item-card.owned { border-color: #ffd700; box-shadow: 0 0 16px rgba(255, 215, 0, 0.2); background: rgba(40, 30, 0, 0.6); }
.i-icon { font-size: 48px; margin-bottom: 8px; }
.i-name { color: #ffffff; font-weight: 700; font-size: 18px; text-shadow: 0 0 6px #ffffff; margin-bottom: 6px; }
.i-desc { color: #aaaaaa; font-size: 13px; margin-bottom: 10px; }
.i-price { color: #ffd700; font-weight: 700; font-family: "VT323", monospace; }

/* Snake */
.snake-grid {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 1px;
  background: #333333;
  border: 3px solid #444444;
  max-width: 420px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
}
.snake-seg {
  background: #ffffff;
  box-shadow: 0 0 4px #ffffff;
}
.snake-seg.head {
  background: #cccccc;
  box-shadow: 0 0 8px #ffffff, 0 0 16px #ffffff;
}
.snake-food {
  background: #ff4466;
  border-radius: 50%;
  box-shadow: 0 0 8px #ff4466, 0 0 16px #ff4466;
  animation: food-pulse 1s ease-in-out infinite;
}
@keyframes food-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 8px #ff4466, 0 0 16px #ff4466; }
  50% { transform: scale(1.1); box-shadow: 0 0 12px #ff4466, 0 0 24px #ff4466; }
}

/* Pong canvas handled inline */

/* Golden banner glow */
body.golden .logo {
  color: #ffd700;
  text-shadow:
    0 0 4px #ffd700,
    0 0 12px #ff8c00,
    0 0 24px #ff4500;
}
body.golden .topbar { border-bottom-color: #aa8800; }
body.golden .logo::before { content: "\2726\2726 "; color: #ffd700; }
body.golden .logo::after  { content: " \2726\2726"; color: #ffd700; }

/* Scanline overlay for full CRT feel */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* Subtle CRT flicker on interactive elements */
@keyframes crt-flicker {
  0%, 100% { opacity: 1; }
  95% { opacity: 0.98; }
  97% { opacity: 1; }
}
button, .card, .diff-btn, .rps-btn, .kbd-btn, .mem-tile, .ms-cell, .bcard, .rlt-type, .rlt-num, .item-card {
  animation: crt-flicker 3s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .kac-kicker, .kac-name, .btn, .card, .diff-btn, .rps-btn, .kbd-btn, .mem-tile, .ms-cell, .bcard, .rlt-type, .rlt-num, .item-card {
    animation: none !important;
  }
  .snake-food { animation: none !important; }
}


/* ---------- terminal-style menu (matches the game) ---------- */
.term {
  max-width: 660px;
  margin: 6px auto 0;
  font-family: "VT323", "Courier New", ui-monospace, monospace;
  font-size: 19px;
  line-height: 1.45;
  color: #ffffff;
  background: rgba(18, 18, 18, 0.72);
  border: 2px solid #444444;
  border-radius: 6px;
  padding: 20px 26px 24px;
  box-shadow:
    inset 0 0 40px rgba(0, 0, 0, 0.55),
    0 0 20px rgba(255, 255, 255, 0.10);
}
.term-bar {
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  color: #999999;
  line-height: 1.25;
}
.term-title {
  text-align: center;
  font-size: 30px;
  letter-spacing: 7px;
  color: #ffffff;
  text-shadow: 0 0 6px #ffffff, 0 0 18px #ffffff;
  padding: 5px 0 3px;
}
.term-tag {
  text-align: center;
  color: #aaaaaa;
  margin-top: 3px;
}
.term-points {
  text-align: center;
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.55);
  margin: 16px 0 12px;
}
.term-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 4px 0 10px;
}
.term-item {
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  outline: none;
}
.term-item:hover,
.term-item:focus {
  background: rgba(255, 255, 255, 0.10);
  border-color: #444444;
  text-shadow: 0 0 8px #ffffff;
}
.term-num {
  display: inline-block;
  width: 2.6em;
  text-align: right;
  margin-right: 4px;
  color: #999999;
}
.term-note {
  color: #888888;
  font-size: 15px;
  margin-top: 8px;
}
.term-pick {
  margin-top: 12px;
  color: #ffffff;
  text-shadow: 0 0 6px #ffffff;
}
.term-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  background: #ffffff;
  margin-left: 7px;
  vertical-align: -2px;
  box-shadow: 0 0 6px #ffffff;
  animation: term-blink 1s steps(1) infinite;
}
@keyframes term-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
body.golden .term-title {
  color: #ffd700;
  text-shadow: 0 0 6px #ffd700, 0 0 16px #ff8c00;
}
@media (max-width: 560px) {
  .term { font-size: 16px; padding: 14px 12px 18px; }
  .term-title { font-size: 22px; letter-spacing: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .term-cursor { animation: none; }
}


/* ============================================================
   anti-template overrides: flat borders, no glow, no rounding,
   no bouncy transitions - classic terminal look
   ============================================================ */
*, *::before, *::after {
  border-radius: 0 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  animation: none !important;
  transition: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.term-cursor { animation: term-blink 1s steps(1) infinite !important; }

/* DOS-style buttons: outline, invert on hover */
.btn { background: #000 !important; border: 1px solid #fff !important; color: #fff !important; }
.btn:hover:not(:disabled) { background: #fff !important; color: #000 !important; }
.btn.alt { border-color: #999 !important; color: #ccc !important; }
.btn.alt:hover { background: #ccc !important; color: #000 !important; }
.btn.gold { background: #000 !important; border-color: #ffd700 !important; color: #ffd700 !important; }
.btn.gold:hover { background: #ffd700 !important; color: #000 !important; }
.btn.ghost { background: #000 !important; border: 1px solid #666 !important; color: #ccc !important; }
.btn.ghost:hover { border-color: #fff !important; color: #fff !important; }
.btn:disabled { background: #000 !important; border-color: #444 !important; color: #444 !important; }

.diff-btn { background: #000 !important; border: 1px solid #666 !important; color: #fff !important; }
.diff-btn:hover { background: #fff !important; color: #000 !important; border-color: #fff !important; }
.diff-btn .d-name, .diff-btn .d-sub { color: inherit !important; }

.rps-btn { background: #000 !important; border: 1px solid #fff !important; color: #fff !important; font-weight: 700; }
.rps-btn:hover { background: #fff !important; color: #000 !important; }

/* menu rows invert on hover, like a DOS selector */
.term-item:hover, .term-item:focus { background: #fff !important; color: #000 !important; border-color: #fff !important; }
.term-item:hover .term-num, .term-item:focus .term-num { color: #000 !important; }

.lang-btn.active { background: #fff !important; color: #000 !important; }
.points-pill { background: #000 !important; }
.topbar { background: #000 !important; border-bottom: 1px solid #666 !important; }
body.golden .topbar { border-bottom-color: #ffd700 !important; }

.mem-tile { background: #0a0a0a !important; background-image: none !important; }
.mem-tile.up { background: #161616 !important; background-image: none !important; border-color: #fff !important; }
.mem-tile.matched { border-color: #fff !important; }

.game-panel { border: 1px solid #666 !important; }
.term { border: 1px solid #666 !important; }
/* ============================================================
   multiplayer: room bar, lobby, watch overlay, forms
   ============================================================ */
.room-bar {
  border: 1px solid #666;
  background: #000;
  padding: 10px 12px;
  margin: 10px 0 4px;
  font-family: "VT323", "Courier New", ui-monospace, monospace;
}
.room-code {
  font-size: 34px;
  letter-spacing: 12px;
  color: #fff;
  cursor: pointer;
  margin: 2px 0 6px;
  display: inline-block;
}
.room-code:hover { background: #fff; color: #000; }
.room-hint { color: #999; font-size: 14px; margin: 2px 0; }
.lobby { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.lobby-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border: 1px solid #444; background: #000; padding: 8px 10px;
  font-family: "VT323", "Courier New", monospace; font-size: 17px;
}
.lobby-row .lr-name { color: #fff; font-weight: 700; min-width: 110px; }
.lobby-row .lr-you { color: #ffd700; }
.lobby-row .lr-status { color: #999; flex: 1; }
.lobby-row .btn { font-size: 12px; padding: 4px 10px; }
.watch-box {
  position: fixed;
  top: 64px; right: 16px; bottom: 16px;
  width: min(560px, calc(100vw - 32px));
  background: #000;
  border: 2px solid #fff;
  z-index: 300;
  display: none;
  flex-direction: column;
}
.watch-box.on { display: flex; }
.watch-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; border-bottom: 1px solid #666; padding: 8px 10px;
  font-family: "VT323", "Courier New", monospace; color: #fff; font-size: 16px;
}
.watch-body { overflow: auto; padding: 12px; pointer-events: none; }
.mp-score {
  font-size: 20px; font-weight: 700; color: #fff;
  margin: 6px 0; font-family: "VT323", "Courier New", monospace;
}
.mp-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0; }



/* ============================================================
   HUMAN-MADE ARTIFACTS: leader dots, wobbles, badges, stripes
   ============================================================ */
.ticker {
  border-bottom: 1px solid #444;
  background: #000;
  overflow: hidden;
  white-space: nowrap;
}
.ticker-track {
  display: inline-block;
  padding: 5px 0;
  font-family: "VT323", "Courier New", ui-monospace, monospace;
  font-size: 16px;
  color: #ccc;
  letter-spacing: 1px;
  animation: ticker-run 34s linear infinite !important;
}
.ticker-track span { padding-right: 2em; }
@keyframes ticker-run {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none !important; }
}

/* under construction style (permanently) */
.construction {
  border-bottom: 1px solid #444;
  background: repeating-linear-gradient(-45deg, #ffd700 0 14px, #111 14px 28px);
  text-align: center;
  padding: 6px 8px;
}
.construction span {
  display: inline-block;
  background: #000;
  color: #ffd700;
  padding: 3px 14px;
  font-family: "VT323", "Courier New", ui-monospace, monospace;
  font-size: 15px;
  border: 1px solid #ffd700;
}

/* beta tag - because it IS a beta */
.beta-tag {
  font-size: 10px;
  letter-spacing: 1px;
  color: #999;
  border: 1px solid #555;
  padding: 1px 6px;
  margin-left: 8px;
  vertical-align: super;
  font-family: "VT323", monospace;
  text-decoration: none;
  text-shadow: none;
}
.logo {
  text-decoration: underline wavy;
  text-decoration-color: #555;
  text-underline-offset: 7px;
}

/* directory-style leader dots, like a real file listing */
.term { cursor: crosshair; }
.term-item {
  display: flex;
  align-items: center;
}
.term-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lead {
  flex: 1 1 auto;
  border-bottom: 1px dotted #555;
  margin: 0 8px;
  min-width: 12px;
}
.term-item:hover .lead,
.term-item:focus .lead { border-bottom-color: #000; }
.term-item:hover .term-num,
.term-item:focus .term-num { color: #000 !important; }
.term-tag {
  font-size: 13px;
  color: #000;
  background: #ccc;
  padding: 0 6px;
  letter-spacing: 1px;
  margin-left: 6px;
}
.term-hello { color: #fff; margin: 0 0 8px; }
.fav { color: #ffd700; font-size: 14px; }

/* changelog - because real projects have history */
.changelog {
  max-width: 660px;
  margin: 34px auto 0;
  padding: 0 16px;
}
.cl-title {
  font-family: "VT323", "Courier New", ui-monospace, monospace;
  font-size: 20px;
  font-weight: 400;
  color: #fff;
  letter-spacing: 2px;
  border-bottom: 1px dashed #555;
  padding-bottom: 6px;
  margin: 0;
}
.cl-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  font-family: "VT323", "Courier New", ui-monospace, monospace;
  font-size: 16px;
  color: #aaa;
  line-height: 1.7;
}
.cl-list li::before { content: "> "; color: #ffd700; }
.cl-list b { color: #fff; font-weight: 400; }

/* footer with counter, ascii art, badges */
.footer {
  border-top: 1px solid #444;
  margin-top: 36px;
  padding: 22px 16px 48px;
  text-align: center;
  font-family: "VT323", "Courier New", ui-monospace, monospace;
  color: #999;
}
.counter-line { font-size: 17px; color: #ccc; }
.counter {
  display: inline-block;
  border: 1px solid #777;
  background: #000;
  color: #fff;
  font-weight: 700;
  letter-spacing: 4px;
  padding: 3px 10px;
  margin: 0 4px;
  font-size: 18px;
}
.counter-note { color: #777; font-size: 14px; }
.footer-art {
  display: inline-block;
  text-align: left;
  color: #888;
  transform: rotate(-1.2deg);
  margin: 14px 0 8px;
  font-size: 15px;
  line-height: 1.35;
}
.footer-blurb { font-size: 15px; line-height: 1.7; margin: 6px 0 0; }
.footer-tiny { color: #666; font-size: 13px; }
.badge {
  display: inline-block;
  border: 1px dashed #777;
  padding: 2px 9px;
  margin: 3px;
  font-size: 13px;
  color: #bbb;
  letter-spacing: 1px;
}
.note-wobble {
  display: inline-block;
  text-align: left;
  font-family: "Comic Sans MS", "Comic Sans", cursive;
  font-size: 15px;
  color: #e0e0e0;
  border: 2px dashed #666;
  background: #0b0b0b;
  padding: 10px 14px;
  margin: 16px auto 4px;
  transform: rotate(-1.4deg);
  max-width: 460px;
}
