/* Card Table palette (CtScreen defaults) */
:root {
  --bg: #0f1218; --panel: #161a22; --panel2: #12161d; --cell: #1f2430; --border: #2a303c;
  --btn: #2b3242; --btn-b: #4a5468; --gold: #e3b341; --gold-hi: #f5cf6b; --text: #e8eaf0; --text2: #c3c9d5;
  --muted: #9aa3b5; --felt: #173a2a; --green: #7bd389; --red: #e66b6b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 650; }
h2 { font-size: 17px; color: var(--gold); letter-spacing: .02em; }
h3 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 18px 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.boot { display: grid; place-items: center; height: 100%; color: var(--muted); }

/* buttons + inputs */
.btn {
  background: var(--btn); color: var(--text); border: 1px solid var(--btn-b); border-radius: 6px;
  padding: 8px 14px; font: inherit; cursor: pointer;
}
.btn:hover { border-color: var(--gold); }
.btn:focus-visible, input:focus-visible, .link:focus-visible, .tab:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn.gold { background: var(--gold); border-color: var(--gold-hi); color: #1a1408; font-weight: 650; }
.btn.gold:hover { background: var(--gold-hi); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.danger:hover { border-color: var(--red); color: var(--red); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.link { background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; padding: 0; }
.link:hover { color: var(--gold-hi); text-decoration: underline; }
input, textarea {
  width: 100%; background: var(--panel2); color: var(--text); border: 1px solid var(--border); border-radius: 6px;
  padding: 9px 11px; font: inherit;
}
input:focus, textarea:focus { border-color: var(--gold); outline: none; }
label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 12px; }
label input { margin-top: 4px; }
.error { color: var(--red); min-height: 1.2em; margin: 0 0 10px; font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; margin: -4px 0 10px; }

/* sign in */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(ellipse at 50% 30%, #1d4a36 0%, var(--felt) 45%, #0b1d15 100%); }
.auth-card { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--border);
  border-top: 3px solid var(--gold); border-radius: 10px; padding: 26px 26px 18px; box-shadow: 0 20px 60px #0008; }
.auth-logo { width: 56px; display: block; margin: 0 auto 8px; image-rendering: pixelated; border-radius: 4px; }
.auth h1 { text-align: center; font-size: 24px; margin-bottom: 16px; }
.tabs { display: flex; gap: 4px; background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; padding: 3px; margin-bottom: 16px; }
.tab { flex: 1; background: none; border: 0; color: var(--muted); padding: 7px; border-radius: 6px; font: inherit; cursor: pointer; }
.tab.on { background: var(--btn); color: var(--text); }
.fine { color: var(--muted); font-size: 12px; text-align: center; margin: 14px 0 0; }

/* home */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px;
  background: var(--panel); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 17px; }
.brand img { width: 26px; image-rendering: pixelated; border-radius: 3px; }
.me { display: flex; align-items: center; gap: 12px; }
.me .link { font-weight: 600; }
.cols { display: grid; grid-template-columns: 1fr 360px; gap: 18px; padding: 18px 20px; max-width: 1200px; margin: 0 auto; }
@media (max-width: 820px) { .cols { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.felt { margin-top: 12px; min-height: 320px; border-radius: 8px; padding: 28px;
  background: radial-gradient(ellipse at 50% 40%, #1f4d38, var(--felt) 70%); border: 1px solid #ffffff14;
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.felt-title { font-size: 18px; font-weight: 650; margin: 0 0 6px; }
.felt .muted { max-width: 440px; margin: 0; }
.felt-go { display: inline-block; margin-top: 18px; text-decoration: none; }
.count { color: var(--muted); font-weight: 400; font-size: 14px; }
.search { margin-top: 12px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; }
.list li:hover { background: var(--cell); }
.list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .sub { color: var(--muted); font-size: 12px; }
.list .acts { display: flex; gap: 6px; }
#search-results:not(:empty) { margin-top: 6px; border: 1px solid var(--border); border-radius: 8px; padding: 4px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #4a5263; flex: none; }
.dot.on { background: var(--green); box-shadow: 0 0 6px #7bd38988; }
.btn.vis { display: inline-flex; align-items: center; gap: 6px; }

/* profile modal */
.modal { position: fixed; inset: 0; background: #0009; display: grid; place-items: center; padding: 20px; z-index: 10; }
.modal-card { position: relative; width: min(420px, 100%); background: var(--panel); border: 1px solid var(--border);
  border-top: 3px solid var(--gold); border-radius: 10px; padding: 22px; max-height: 90vh; overflow: auto; }
.close { position: absolute; top: 8px; right: 10px; background: none; border: 0; color: var(--muted); font-size: 24px; cursor: pointer; }
.close:hover { color: var(--text); }
.prof-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.prof-head h2 { color: var(--text); font-size: 20px; }
.avatar { width: 48px; height: 48px; border-radius: 8px; display: grid; place-items: center; font-weight: 700;
  font-size: 22px; color: #1a1408; background: var(--gold); flex: none; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.stat { background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; padding: 8px; text-align: center; }
.stat b { display: block; font-size: 15px; }
.stat span { color: var(--muted); font-size: 12px; }
.bio { white-space: pre-wrap; background: var(--panel2); border-radius: 8px; padding: 10px 12px; color: var(--text2); margin: 0 0 14px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row .btn { flex: 1; }
textarea { min-height: 70px; resize: vertical; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--cell);
  border: 1px solid var(--gold); padding: 9px 16px; border-radius: 8px; z-index: 20; box-shadow: 0 8px 30px #0008; }
/* W7: a game invite while on this page */
.invite-banner { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 50; display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--gold); border-radius: 8px; padding: 10px 14px; box-shadow: 0 6px 24px #0008; }
.felt-welcome { margin: 0 0 10px; padding: 8px 12px; border-left: 3px solid var(--gold); background: rgba(0,0,0,.22);
  color: var(--gold-hi); font-weight: 600; border-radius: 4px; }
.cols.fresh { grid-template-columns: minmax(0, 760px); justify-content: center; } /* new account: the Play panel alone */
/* sir 2026-11-28: profile pictures (pixel art on a canvas) */
canvas.av { image-rendering: pixelated; border-radius: 6px; flex: none; vertical-align: middle; }
canvas.av.inline { border-radius: 4px; margin-right: 2px; }
canvas.av.big { border-radius: 8px; }
.av-pick > span { display: block; font-size: 13px; margin-bottom: 6px; }
.av-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin: 4px 0 10px; }
.av-btn { padding: 2px; border: 2px solid transparent; border-radius: 8px; background: none; cursor: pointer; line-height: 0; }
.av-btn:hover { border-color: #8e97aa; }
.av-btn.on { border-color: #e3b341; }
.list li canvas.av { margin-right: 4px; }
.av-btn canvas.av { width: 100% !important; height: auto !important; aspect-ratio: 1; }
/* sir 2026-11-29: commander faces (a square of the art crop); tier 2 gold glint, tier 3 prism foil under the glint
   (the picture animates: outlines clashed with portrait borders) */
.av.face { display: inline-block; flex: none; vertical-align: middle; border-radius: 6px; background-repeat: no-repeat;
  background-color: #1a1d24; box-shadow: inset 0 0 0 1px #0008; box-sizing: border-box; }
.av.face.inline { border-radius: 4px; margin-right: 2px; }
.av.face.big { border-radius: 8px; }
/* sir 2026-11-29: the Lv 10 pick draws on ::after, the Lv 15 pick on ::before (Profile > Cosmetics; the game draws the same set) */
@property --z { syntax: "<number>"; inherits: false; initial-value: 1; }
.av.face { background-size: calc(var(--bw, 100%) * var(--z)) calc(var(--bh, 100%) * var(--z)); }
.av.face.t2, .av.face.t3 { position: relative; overflow: hidden; }
.av.face::after, .av.face::before { position: absolute; inset: 0; pointer-events: none; }
.av.face.fa-glint::after { content: ""; background: linear-gradient(118deg, transparent 40%, rgba(255,230,168,.6) 50%, transparent 60%) no-repeat;
  background-size: 300% 300%; animation: av-glint 4s linear infinite; }
@keyframes av-glint { 0% { background-position: 100% 100%; } 27% { background-position: 0% 0%; } 100% { background-position: 0% 0%; } }
.av.face.fa-breathe { animation: av-breathe 6s ease-in-out infinite; }
@keyframes av-breathe { 0%, 100% { --z: 1; } 50% { --z: 1.1; } }
.av.face.fa-pulse::after { content: ""; background: radial-gradient(circle at 50% 62%, transparent 25%, var(--c1) 100%); opacity: 0;
  animation: av-pulse 5s ease-in-out infinite; }
@keyframes av-pulse { 0%, 100% { opacity: 0; } 50% { opacity: .5; } }
.av.face.fa-motes::after { content: ""; background:
    radial-gradient(circle, #fff 0 1.5px, var(--c1) 2px, transparent 4px) 20% 100% / 100% 100% no-repeat,
    radial-gradient(circle, #fff 0 1px, var(--c1) 1.5px, transparent 3.5px) 70% 100% / 100% 100% no-repeat,
    radial-gradient(circle, #fff 0 1px, var(--c1) 1.5px, transparent 3px) 45% 100% / 100% 100% no-repeat;
  background-size: 30% 30%, 24% 24%, 20% 20%; animation: av-motes 6s linear infinite; }
@keyframes av-motes { 0% { background-position: 20% 130%, 70% 160%, 45% 190%; opacity: 0; } 15% { opacity: 1; }
  85% { opacity: 1; } 100% { background-position: 25% -40%, 65% -20%, 50% 0%; opacity: 0; } }
.av.face.fa-sheen::after { content: ""; opacity: .3;
  background: linear-gradient(135deg, #ff5f8f, #ffd75a, #6fe39a, #5fb6ff, #c78bff, #ff5f8f) 0 0 / 300% 300%; animation: av-foil 4s linear infinite; }
.av.face.fb-foil::before { content: ""; mix-blend-mode: overlay; opacity: .7;
  background: linear-gradient(135deg, #ff5f8f, #ffd75a, #6fe39a, #5fb6ff, #c78bff, #ff5f8f, #ffd75a, #6fe39a) 0 0 / 300% 300%;
  animation: av-foil 6s linear infinite; }
@keyframes av-foil { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }
.av.face.fb-flames::before { content: ""; background: linear-gradient(to top, var(--c1), transparent 55%); opacity: .6;
  animation: av-flame .9s ease-in-out infinite alternate; }
@keyframes av-flame { from { opacity: .4; } to { opacity: .75; } }
.av.face.fb-ripple::before { content: ""; background: linear-gradient(to bottom, transparent 42%, rgba(200,235,255,.35) 50%, transparent 58%) 0 0 / 100% 300% no-repeat;
  animation: av-ripple 4.5s linear infinite; }
@keyframes av-ripple { from { background-position: 0 100%; } to { background-position: 0 0; } }
.av.face.fb-pixel::before { content: ""; background: var(--c1); opacity: 0; animation: av-pixel 7s steps(1, end) infinite; }
@keyframes av-pixel { 0% { opacity: .55; } 3% { opacity: .35; } 8% { opacity: .15; } 15%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .av.face, .av.face::after, .av.face::before { animation: none !important; } }
.av-btn .av.face { width: 100% !important; height: auto !important; aspect-ratio: 1; }

/* ================= Corner Games (sir 2026-11-29): the sign-in and start pages in the shop's look =================
   walnut planks, brass plates and buttons, paper cards with ink, flat felt in a wood rail */
@font-face { font-family: "Courier Prime"; font-weight: 400; font-display: swap; src: url("/play/fonts/courierprime-400.woff2") format("woff2"); }
@font-face { font-family: "Courier Prime"; font-weight: 700; font-display: swap; src: url("/play/fonts/courierprime-700.woff2") format("woff2"); }
@font-face { font-family: "Gloria Hallelujah"; font-weight: 400; font-display: swap; src: url("/play/fonts/gloria-400.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu"; font-weight: 400; font-display: swap; src: url("/play/fonts/ubuntu-400.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu"; font-weight: 700; font-display: swap; src: url("/play/fonts/ubuntu-700.woff2") format("woff2"); }
:root {
  --bg: #24170e; --panel: #2a1b10; --panel2: #1c120b; --cell: #3a2616; --border: #4a3020;
  --btn: #3a2616; --btn-b: #8a6038; --gold: #c9a23c; --gold-hi: #f0d27a; --text: #f1e7cc; --text2: #d8cba8;
  --muted: #b39f7c; --felt: #173a2a; --green: #8fae7a; --red: #d0705c;
  --paper: #f1e7cc; --ink: #2a2418; --ink2: #5a4a30; --rule-red: #b0453a; --rule-blue: #6c8fb855;
  --wood: #5a3a22; --wood-dk: #1a100a;
}
body {
  font-family: "Ubuntu", system-ui, sans-serif;
  background-color: #24170e;
  background-image:
    repeating-linear-gradient(180deg, transparent 0 21px, #120b0699 21px 22px, #ffffff0a 22px 23px, transparent 23px 44px),
    repeating-linear-gradient(90deg, transparent 0 127px, #120b0666 127px 128px),
    linear-gradient(180deg, #2c1c11, #1f140c);
  background-attachment: fixed;
}
h2 { font-family: "Courier Prime", monospace; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 13px;
  display: inline-block; color: #2a1d08; padding: 4px 9px 3px; border: 1px solid #6e5216;
  background: linear-gradient(#f0d27a 0 50%, #c9a23c 50%); box-shadow: inset 0 1px 0 #fff3c4, 2px 2px 0 #0b070499; }
h2 .count { color: #5a4316; font-size: 12px; }
h3 { color: var(--gold); font-family: "Courier Prime", monospace; font-weight: 700; }
.boot { font-family: "Courier Prime", monospace; color: var(--text2); letter-spacing: .08em; }

.btn { background: var(--btn); color: var(--text); border: 1px solid var(--btn-b); border-radius: 2px;
  box-shadow: inset 0 1px 0 #ffffff14, 0 2px 0 #0b0704; }
.btn:hover { border-color: var(--gold-hi); background: #4a3020; }
.btn.gold { background: linear-gradient(#f0d27a 0 50%, #c9a23c 50%); border-color: #6e5216; color: #2a1d08;
  font-family: "Courier Prime", monospace; font-weight: 700; letter-spacing: .04em; box-shadow: inset 0 1px 0 #fff3c4, 0 2px 0 #0b0704; }
.btn.gold:hover { background: linear-gradient(#fff0b0 0 50%, #e0b94c 50%); }
input, textarea { background: #fbf6e8; color: var(--ink); border: 1px solid #b9a67e; border-radius: 2px; }
input:focus, textarea:focus { border-color: #9a7420; box-shadow: 0 0 0 2px #f0d27a66; }
input::placeholder { color: #9a8a6a; }

/* sign in: an index card on the counter */
.auth { background: none; }
.auth-card { background-color: var(--paper); color: var(--ink); border: 0; border-top: 4px solid var(--rule-red); border-radius: 1px;
  background-image: repeating-linear-gradient(180deg, transparent 0 27px, var(--rule-blue) 27px 28px);
  background-position: 0 70px; box-shadow: 4px 4px 0 #0b0704aa, 0 18px 50px #000a; }
.auth h1 { font-family: "Courier Prime", monospace; font-weight: 700; color: var(--ink); letter-spacing: .02em; }
.auth h1::before { content: "CORNER GAMES"; display: block; font-size: 11px; letter-spacing: .2em; color: var(--rule-red); margin-bottom: 2px; }
.auth label { color: var(--ink2); }
.auth .tabs { background: #e2d6b8; border: 1px solid #c8b994; border-radius: 2px; }
.auth .tab { color: var(--ink2); border-radius: 1px; font-family: "Courier Prime", monospace; font-weight: 700; }
.auth .tab.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 0 #b9a67e; }
.auth .hint, .auth .fine { color: var(--ink2); }
.auth .fine { font-family: "Gloria Hallelujah", cursive; font-size: 13px; }
.auth .error { color: var(--rule-red); }
.auth-logo { border-radius: 2px; box-shadow: 2px 2px 0 #0b070466; }

/* home */
.topbar { background: linear-gradient(#2e1e12, #1f140c); border-bottom: 2px solid #c9a23c; box-shadow: 0 2px 0 #6e5216, 0 6px 16px #0008; }
.brand { font-family: "Courier Prime", monospace; font-weight: 700; color: var(--text); }
.brand::after { content: "CORNER GAMES"; font-size: 10px; letter-spacing: .18em; color: var(--gold); margin-left: 4px; }
.panel { background: #24170ee6; border: 2px solid #1a100a; border-radius: 2px; box-shadow: inset 0 0 0 2px #4a3020, 0 3px 0 #0e0805; }
.felt { border-radius: 1px; background: var(--felt); border: 10px solid var(--wood); outline: 2px solid var(--wood-dk);
  box-shadow: inset 0 0 0 1px #8a6038, inset 0 1px 0 2px #ffffff10; }
.felt-title { font-family: "Courier Prime", monospace; font-weight: 700; font-size: 20px; color: var(--text); }
.felt .muted { color: #c8d8c8; }
.felt-welcome { background: var(--paper); color: var(--ink); border-left: 4px solid var(--rule-red); font-family: "Gloria Hallelujah", cursive; font-weight: 400; }
.list li:hover { background: #3a2616; }
#search-results:not(:empty) { border-color: var(--border); background: #1c120b; }
.dot { background: #6b5a44; }
.modal-card { background: var(--paper); color: var(--ink); border: 0; border-top: 4px solid var(--rule-red); border-radius: 1px; box-shadow: 4px 4px 0 #0b0704aa; }
.modal-card .muted, .modal-card label { color: var(--ink2); }
.modal-card .btn:not(.gold) { background: #e2d6b8; color: var(--ink); border-color: #b9a67e; }
.prof-head h2 { color: var(--ink); background: none; border: 0; box-shadow: none; padding: 0; text-transform: none; font-size: 20px; letter-spacing: 0; }
.stat, .bio { background: #e8dcbf; border-color: #c8b994; color: var(--ink); }
.stat span { color: var(--ink2); }
.close { color: var(--ink2); }
.close:hover { color: var(--ink); }
.toast, .invite-banner { background: var(--paper); color: var(--ink); border: 1px solid #6e5216; border-radius: 1px; box-shadow: 3px 3px 0 #0b0704aa; }
