/* =====================================================================
   CHICKEN CROSSING - stylesheet
   Colours live in CSS variables (also overridable from config.js -> theme)
   ===================================================================== */
@font-face {
  font-family: 'Lilita One'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/LilitaOne-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Lilita One'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/LilitaOne-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --c-outline: #1b1244;
  --c-bg-1: #2a1b6e;
  --c-bg-2: #14093f;
  --c-panel: #3a2a8f;
  --c-panel-2: #2b1d73;
  --c-accent: #ffd426;
  --c-go: #3ddc4a;
  --c-cash: #ffb21f;
  --c-danger: #ff4a3d;
  --c-text: #ffffff;
  --font: 'Lilita One', 'Luckiest Guy', 'Arial Black', Impact, sans-serif;
  --ts: 0 2px 0 var(--c-outline), 2px 0 0 var(--c-outline), -2px 0 0 var(--c-outline), 0 -2px 0 var(--c-outline), 2px 2px 0 var(--c-outline), -2px -2px 0 var(--c-outline), 2px -2px 0 var(--c-outline), -2px 2px 0 var(--c-outline), 0 4px 0 var(--c-outline);
  --ts-l: 0 4px 0 var(--c-outline), 4px 0 0 var(--c-outline), -4px 0 0 var(--c-outline), 0 -4px 0 var(--c-outline), 3px 3px 0 var(--c-outline), -3px -3px 0 var(--c-outline), 3px -3px 0 var(--c-outline), -3px 3px 0 var(--c-outline), 0 7px 0 var(--c-outline);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; overflow: hidden; }
button, input { touch-action: manipulation; }
body {
  font-family: var(--font); color: var(--c-text); letter-spacing: .3px;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(140,110,255,.35), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.035) 0 22px, rgba(255,255,255,0) 22px 44px),
    linear-gradient(180deg, var(--c-bg-1), var(--c-bg-2));
  background-attachment: fixed;
  overflow-x: hidden; -webkit-user-select: none; user-select: none;
}
button { font-family: inherit; }
input, select { font-family: inherit; }
[hidden] { display: none !important; }

#app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; max-width: 1560px; margin: 0 auto; padding: 0 14px 12px; }

/* ---------- card ---------- */
.card {
  background: linear-gradient(180deg, var(--c-panel) 0%, var(--c-panel-2) 100%);
  border: 4px solid var(--c-outline); border-radius: 22px;
  box-shadow: 0 6px 0 rgba(8,3,32,.7), inset 0 3px 0 rgba(255,255,255,.16);
}

/* ---------- top bar ---------- */
#topbar { display: flex; align-items: center; gap: 10px; padding: 8px 2px; flex: 0 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand img { filter: drop-shadow(0 4px 0 rgba(8,3,32,.55)); }
.logo-text {
  margin: 0; font-weight: 400; font-size: 34px; line-height: 1; text-transform: uppercase; letter-spacing: 1px; color: #ffd426;
  text-shadow: var(--ts), 0 5px 0 rgba(8,3,32,.7);
}
.online { display: flex; align-items: center; gap: 7px; font-size: 16px; opacity: .95; text-shadow: var(--ts); }
.online .dot { width: 11px; height: 11px; border-radius: 50%; background: #5dff6e; border: 2px solid var(--c-outline); box-shadow: 0 0 10px #5dff6e; }
.top-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 46px; height: 46px; padding: 0; display: grid; place-items: center; cursor: pointer; color: #fff;
  background: linear-gradient(180deg, #6f5ae6, #4a38b8); border: 4px solid var(--c-outline); border-radius: 15px;
  box-shadow: 0 5px 0 var(--c-outline), inset 0 3px 0 rgba(255,255,255,.3); transition: transform .06s, box-shadow .06s;
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--c-outline), inset 0 3px 0 rgba(255,255,255,.3); }
.icon-btn svg { width: 24px; height: 24px; fill: #fff; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 2px 0 rgba(27,18,68,.8)); }
.icon-btn svg path[fill=none], .icon-btn svg [fill=none] { fill: none; }
.icon-btn.off { filter: grayscale(.9) brightness(.7); }
.icon-btn.gfx { width: auto; min-width: 62px; padding: 0 10px; font-size: 14px; letter-spacing: .5px; color: #fff; text-shadow: var(--ts); }
.icon-btn.off svg .wave { display: none; }
.balance-pill {
  display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 10px; min-width: 190px;
  background: linear-gradient(180deg, #23166b, #170d4d); border: 4px solid var(--c-outline); border-radius: 18px;
  box-shadow: 0 5px 0 rgba(8,3,32,.7), inset 0 3px 8px rgba(0,0,0,.35);
}
.balance-pill .coin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--c-outline); background: radial-gradient(circle at 35% 30%, #fff6a8, #ffc21a 55%, #d98c00); box-shadow: inset 0 -3px 0 rgba(0,0,0,.2); position: relative; }
.balance-pill .coin::after { content: ''; position: absolute; top: 8px; right: 8px; bottom: 8px; left: 8px; border-radius: 50%; border: 2.5px solid rgba(217,140,0,.8); }
.bal-txt { display: flex; flex-direction: column; line-height: 1; flex: 1; }
.bal-txt small { font-size: 12px; opacity: .7; letter-spacing: 1px; text-transform: uppercase; }
.bal-txt b { font-size: 26px; color: var(--c-accent); text-shadow: var(--ts); font-weight: 400; margin-top: 3px; }
.plus-btn { width: 36px; height: 36px; font-size: 26px; line-height: 1; color: #fff; cursor: pointer; border-radius: 12px; border: 3px solid var(--c-outline); background: linear-gradient(180deg, #7dff6a, #25c93a); box-shadow: 0 3px 0 var(--c-outline), inset 0 2px 0 rgba(255,255,255,.5); text-shadow: var(--ts); padding: 0; }
.plus-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--c-outline); }
.balance-pill.bump b { animation: bump .35s; }
.balance-pill.err { animation: shake .35s; }
@keyframes bump { 40% { transform: scale(1.18); } }
@keyframes shake { 20% { transform: translateX(-7px); } 60% { transform: translateX(7px); } }

/* ---------- layout ---------- */
#layout { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; }
#gameCol { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }
#stage {
  position: relative; flex: 1 1 0; min-height: 160px;
  border: 5px solid var(--c-outline); border-radius: 26px; background: #55c845;
  box-shadow: 0 7px 0 rgba(8,3,32,.7), 0 0 0 3px rgba(255,255,255,.12) inset;
}
#cv { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; display: block; touch-action: none; border-radius: 21px; }
#hud { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; }

#history { position: absolute; left: 12px; top: 12px; max-width: 26%; display: flex; gap: 5px; overflow: hidden; flex-wrap: nowrap; }
.h-chip { font-size: 13px; padding: 2px 8px; border-radius: 12px; border: 3px solid var(--c-outline); text-shadow: var(--ts); background: #5a4bd0; box-shadow: 0 3px 0 rgba(8,3,32,.55); animation: pop .3s; flex: 0 0 auto; }
.h-chip.win { background: linear-gradient(#69f070, #25b83a); }
.h-chip.big { background: linear-gradient(#ffe45a, #ff9a1f); }
.h-chip.lose { background: linear-gradient(#ff7d70, #d92b1c); }

#multBox { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); text-align: center; }
.mult-val {
  font-size: clamp(34px, 4.4vw, 58px); line-height: 1; letter-spacing: 1px; color: #ffd426;
  text-shadow: var(--ts), 0 6px 0 rgba(8,3,32,.6);
  transition: transform .12s;
}
.mult-val.pop { animation: multpop .45s; }
.mult-val.dim { color: #e3d79a; }
.mult-val.dead { color: #ff6a5e; }
@keyframes multpop { 0% { transform: scale(.8); } 45% { transform: scale(1.28) rotate(-2deg); } 100% { transform: scale(1); } }
.mult-sub { margin-top: 3px; display: inline-flex; gap: 6px; flex-wrap: nowrap; justify-content: center; }
.pill { font-size: 14px; padding: 1px 10px; border-radius: 12px; border: 3px solid var(--c-outline); background: rgba(27,18,68,.78); white-space: nowrap; text-shadow: var(--ts); box-shadow: 0 3px 0 rgba(8,3,32,.5); }
.pill b { font-weight: 400; color: var(--c-accent); }
.pill.risk-low b { color: #7dff6a; } .pill.risk-mid b { color: #ffd426; } .pill.risk-high b { color: #ff7a6e; }

.banner { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%) scale(.2); opacity: 0; text-align: center; pointer-events: none; transition: transform .35s cubic-bezier(.2, 1.6, .4, 1), opacity .2s; white-space: nowrap; }
.banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.banner-title { font-size: clamp(44px, 8vw, 96px); line-height: 1; text-shadow: var(--ts-l), 0 10px 0 rgba(8,3,32,.6); transform: rotate(-3deg); }
.banner.win .banner-title { color: #ffd426; }
.banner.lose .banner-title { color: #ff5a4d; }
.banner-amount { font-size: clamp(32px, 5.5vw, 62px); margin-top: 8px; color: #7dff6a; text-shadow: var(--ts-l); }
.banner.lose .banner-amount { color: #ffb0a8; }
.banner-sub { font-size: 22px; margin-top: 4px; text-shadow: var(--ts); opacity: .95; }

#toasts { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.toast { font-size: 14px; padding: 5px 12px 5px 7px; display: flex; gap: 8px; align-items: center; border-radius: 14px; border: 3px solid var(--c-outline); background: rgba(27,18,68,.88); text-shadow: var(--ts); box-shadow: 0 3px 0 rgba(8,3,32,.5); animation: toastin .35s, toastout .4s 3.6s forwards; }
.toast b { color: var(--c-accent); font-weight: 400; }
@keyframes toastin { from { transform: translateX(120%); } }
@keyframes toastout { to { transform: translateX(120%); opacity: 0; } }

#flash { position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 21px; background: radial-gradient(circle, rgba(255,60,60,0) 30%, rgba(255,40,40,.85)); opacity: 0; pointer-events: none; }
#flash.on { animation: flashfx .6s ease-out; }
@keyframes flashfx { 0% { opacity: .75; } 100% { opacity: 0; } }
#loader { position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 21px; display: grid; place-items: center; background: #2a1b6e; transition: opacity .4s; }
#loader.hide { opacity: 0; pointer-events: none; }
.spin { width: 60px; height: 60px; border-radius: 50%; border: 8px solid rgba(255,255,255,.2); border-top-color: var(--c-accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- control panel ---------- */
#panel { flex: 0 0 auto; display: grid; grid-template-columns: minmax(235px, 1fr) minmax(300px, 1.1fr) minmax(200px, 1.2fr); gap: 14px; padding: 12px 16px 14px; }
.blk { display: flex; flex-direction: column; gap: 8px; min-width: 0; justify-content: center; }
.blk-actions { order: 3; }
.lbl { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; opacity: .85; text-shadow: 0 2px 0 rgba(8,3,32,.6); }

.btn {
  position: relative; font-size: 22px; color: #fff; padding: 10px 18px; cursor: pointer; text-shadow: var(--ts);
  border: 4px solid var(--c-outline); border-radius: 17px; background: linear-gradient(180deg, #7560ee, #4a38b8);
  box-shadow: 0 6px 0 var(--c-outline), inset 0 3px 0 rgba(255,255,255,.35); transition: transform .06s, box-shadow .06s, filter .2s;
}
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 var(--c-outline), inset 0 3px 0 rgba(255,255,255,.35); }
.btn:disabled { filter: grayscale(.85) brightness(.75); cursor: not-allowed; }
.btn.small { font-size: 16px; padding: 6px 12px; border-radius: 13px; box-shadow: 0 4px 0 var(--c-outline), inset 0 2px 0 rgba(255,255,255,.35); }
.btn-big { font-size: clamp(30px, 3.2vw, 42px); padding: 10px 10px; min-height: 64px; width: 100%; letter-spacing: 1px; }
.btn-go { background: linear-gradient(180deg, #8bff72, #25c93a 85%); }
.btn-cash { background: linear-gradient(180deg, #ffe45a, #ff9a1f 85%); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; gap: 4px; }
.btn-cash .cash-label { font-size: clamp(22px, 2.2vw, 28px); }
.btn-cash .cash-amt { font-size: clamp(20px, 2vw, 26px); color: #fff; }
.btn-go:not(:disabled):not(.is-play) { animation: goglow 1.4s infinite; }
@keyframes goglow { 50% { transform: scale(1.025); } }
.round-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.blk-actions { justify-content: center; }

.bet-input { display: grid; grid-template-columns: 48px 1fr 48px; gap: 8px; }
.mini { font-size: 30px; line-height: 1; padding: 0; cursor: pointer; color: #fff; text-shadow: var(--ts); border: 4px solid var(--c-outline); border-radius: 14px; background: linear-gradient(180deg, #7560ee, #4a38b8); box-shadow: 0 4px 0 var(--c-outline), inset 0 2px 0 rgba(255,255,255,.35); }
.mini:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--c-outline); }
.mini:disabled { filter: grayscale(.85) brightness(.75); }
.bet-field, .auto-field { display: flex; align-items: center; gap: 6px; padding: 0 12px; border: 4px solid var(--c-outline); border-radius: 14px; background: linear-gradient(180deg, #170d4d, #22166a); box-shadow: inset 0 4px 8px rgba(0,0,0,.45); }
.bet-field input, .auto-field input { width: 100%; min-width: 0; background: none; border: 0; outline: 0; color: var(--c-accent); font-size: 26px; padding: 6px 0; text-shadow: var(--ts); }
.bet-field .cur, .auto-field span { font-size: 24px; opacity: .75; text-shadow: var(--ts); }
.bet-field:focus-within, .auto-field:focus-within { border-color: #8a77ff; }
.bet-field input:disabled, .auto-field input:disabled { opacity: .5; }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  flex: 1 1 0; min-width: 44px; font-size: 17px; color: #fff; padding: 6px 4px; cursor: pointer; text-shadow: var(--ts);
  border: 3px solid var(--c-outline); border-radius: 12px; background: linear-gradient(180deg, #5a47d6, #3c2ba0);
  box-shadow: 0 3px 0 var(--c-outline), inset 0 2px 0 rgba(255,255,255,.28);
}
.chip:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--c-outline); }
.chip:disabled { filter: grayscale(.85) brightness(.75); }
.chips .chip { min-width: 34px; padding: 6px 2px; border-radius: 50px; background: radial-gradient(circle at 35% 30%, #fff6a8, #ffc21a 70%); color: #fff; }
.chips .chip:nth-child(2) { background: radial-gradient(circle at 35% 30%, #b6f7ff, #3db8ff 70%); }
.chips .chip:nth-child(3) { background: radial-gradient(circle at 35% 30%, #c9ffb2, #36d24f 70%); }
.chips .chip:nth-child(4) { background: radial-gradient(circle at 35% 30%, #ffc6e8, #ff5fb1 70%); }
.chips .chip:nth-child(5) { background: radial-gradient(circle at 35% 30%, #e0c7ff, #8d5bff 70%); }

.diffs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.diff {
  position: relative; text-align: left; color: #fff; padding: 7px 10px 6px 34px; cursor: pointer; text-shadow: var(--ts);
  border: 4px solid var(--c-outline); border-radius: 15px; background: linear-gradient(180deg, #4a38b8, #33268f);
  box-shadow: 0 4px 0 var(--c-outline), inset 0 2px 0 rgba(255,255,255,.22); line-height: 1.05; transition: transform .06s;
}
.diff b { display: block; font-weight: 400; font-size: 18px; }
.diff small { font-size: 11px; opacity: .85; white-space: nowrap; }
.diff .dmax { opacity: .85; }
.diff::before { content: ''; position: absolute; left: 9px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: var(--dc); border: 3px solid var(--c-outline); box-shadow: 0 0 8px var(--dc); }
.diff.active { background: linear-gradient(180deg, var(--dc), var(--dc-dark)); transform: translateY(2px); box-shadow: 0 2px 0 var(--c-outline), inset 0 2px 0 rgba(255,255,255,.5); }
.diff.active::before { background: #fff; }
.diff:disabled:not(.active) { filter: grayscale(.8) brightness(.7); cursor: not-allowed; }
.auto-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.auto-field { width: 130px; padding: 0 10px; }
.auto-field input { font-size: 20px; padding: 3px 0; }

/* ---------- side panel ---------- */
#side { display: flex; flex-direction: column; min-height: 0; align-self: stretch; padding: 12px; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.tab { font-size: 16px; color: #fff; padding: 8px 4px; cursor: pointer; text-shadow: var(--ts); border: 3px solid var(--c-outline); border-radius: 13px; background: linear-gradient(180deg, #4a38b8, #33268f); box-shadow: 0 3px 0 var(--c-outline); }
.tab.active { background: linear-gradient(180deg, #ffe45a, #ff9a1f); transform: translateY(2px); box-shadow: 0 1px 0 var(--c-outline); }
.tab-body { display: none; flex: 1; min-height: 0; flex-direction: column; }
.tab-body.active { display: flex; }
.list-head { display: grid; grid-template-columns: 1fr 74px 96px; gap: 6px; padding: 2px 10px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; opacity: .7; }
.list-head span:not(:first-child) { text-align: right; }
.list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; padding: 2px 4px 4px 2px; }
.row-item { display: grid; grid-template-columns: 1fr 74px 96px; gap: 6px; align-items: center; padding: 5px 9px; border-radius: 13px; background: rgba(16,8,60,.55); border: 3px solid rgba(16,8,60,.8); font-size: 15px; }
.row-item.self { border-color: var(--c-accent); background: rgba(255,212,38,.15); }
.row-item.won { background: linear-gradient(90deg, rgba(61,220,74,.28), rgba(16,8,60,.55)); }
.row-item.lost { opacity: .75; background: linear-gradient(90deg, rgba(255,74,61,.22), rgba(16,8,60,.55)); }
.who { display: flex; align-items: center; gap: 7px; min-width: 0; }
.who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--c-outline); display: grid; place-items: center; font-size: 13px; color: #fff; text-shadow: 0 1px 0 var(--c-outline); box-shadow: inset 0 -3px 0 rgba(0,0,0,.2); }
.amt { text-align: right; opacity: .95; }
.res { text-align: right; font-size: 14px; }
.res .m { color: #7dff6a; } .res .x { color: #ff8b80; } .res .p { color: var(--c-accent); }
.prog { height: 5px; border-radius: 3px; background: rgba(0,0,0,.35); margin-top: 3px; overflow: hidden; } .prog i { display: block; height: 100%; background: linear-gradient(90deg, #ffe45a, #ff9a1f); transition: width .4s; }
.top-item { grid-template-columns: 26px 1fr auto; }
.top-item .rank { font-size: 17px; color: var(--c-accent); text-shadow: var(--ts); text-align: center; }
.top-item .win { text-align: right; color: #7dff6a; text-shadow: var(--ts); }
.top-item .win small { display: block; color: #fff; opacity: .7; font-size: 12px; text-shadow: none; }

.chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 2px 4px; }
.msg { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; line-height: 1.25; }
.msg .bubble { background: rgba(16,8,60,.55); border: 3px solid rgba(16,8,60,.8); border-radius: 4px 14px 14px 14px; padding: 4px 10px 5px; min-width: 0; overflow-wrap: break-word; }
.msg.self .bubble { border-color: var(--c-accent); background: rgba(255,212,38,.15); }
.msg .nm { font-size: 13px; opacity: .9; display: block; }
.chat-form { display: flex; gap: 8px; margin-top: 8px; }
.chat-form input { flex: 1; min-width: 0; padding: 8px 12px; font-size: 16px; color: #fff; outline: 0; border: 4px solid var(--c-outline); border-radius: 14px; background: linear-gradient(180deg, #170d4d, #22166a); box-shadow: inset 0 3px 6px rgba(0,0,0,.4); user-select: text; -webkit-user-select: text; }
.mini-send { font-size: 16px; padding: 6px 14px; }

/* ---------- modals ---------- */
.modal { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(8,3,32,.72); animation: fadein .2s; }
.modal-card { position: relative; width: min(560px, 100%); max-height: 90vh; overflow-y: auto; padding: 22px 24px 24px; animation: modalin .3s cubic-bezier(.2,1.5,.4,1); user-select: text; -webkit-user-select: text; }
.modal-card h2 { margin: 0 0 12px; font-size: 32px; font-weight: 400; color: var(--c-accent); text-shadow: var(--ts); }
.modal-card h3 { margin: 16px 0 4px; font-size: 22px; font-weight: 400; text-shadow: var(--ts); }
.modal-card ol { margin: 0 0 8px; padding-left: 24px; font-size: 18px; line-height: 1.4; }
.modal-card li { margin: 6px 0; font-family: 'Trebuchet MS', 'Segoe UI', sans-serif; font-weight: 600; font-size: 16px; }
.modal-card li b { color: var(--c-accent); font-family: var(--font); font-weight: 400; }
.modal-x { position: absolute; right: 12px; top: 10px; width: 40px; height: 40px; font-size: 28px; line-height: 1; padding: 0; cursor: pointer; color: #fff; text-shadow: var(--ts); border: 4px solid var(--c-outline); border-radius: 13px; background: linear-gradient(180deg, #ff7d70, #d92b1c); box-shadow: 0 4px 0 var(--c-outline); }
.muted { opacity: .8; font-family: 'Trebuchet MS', 'Segoe UI', sans-serif; font-weight: 600; font-size: 14px; line-height: 1.4; }
.fair-grid { display: grid; gap: 6px; margin-top: 8px; }
.fair-grid input, .fair-grid select { width: 100%; padding: 8px 12px; font-size: 15px; color: #fff; outline: 0; border: 4px solid var(--c-outline); border-radius: 13px; background: linear-gradient(180deg, #170d4d, #22166a); min-width: 0; }
.row { display: flex; gap: 8px; }
.mono { font-family: Consolas, 'Courier New', monospace; font-size: 13px; background: rgba(0,0,0,.3); border-radius: 10px; padding: 7px 10px; }
.mono.wrap { word-break: break-all; }
#vOut { margin-top: 10px; }
.cellgrid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin-top: 8px; }
.cellgrid i { font-style: normal; text-align: center; font-size: 13px; padding: 5px 0; border-radius: 8px; border: 2px solid var(--c-outline); background: #4a38b8; }
.cellgrid i.trap { background: linear-gradient(#ff7d70, #d92b1c); }
.mult-table { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 5px; margin-top: 8px; font-size: 13px; }
.mult-table span { background: rgba(0,0,0,.28); border-radius: 8px; padding: 3px 6px; text-align: center; font-family: 'Trebuchet MS', sans-serif; font-weight: 700; }
.mult-table span i { font-style: normal; opacity: .6; margin-right: 4px; }
@keyframes fadein { from { opacity: 0; } }
@keyframes modalin { from { transform: scale(.7); opacity: 0; } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

/* ---------- responsive ---------- */
/* ---- top-up window ---- */
.topup-card { width: min(460px, 100%); }
.topup-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 14px; }
.preset { font-size: 20px; color: #fff; padding: 10px 4px; cursor: pointer; text-shadow: var(--ts); border: 4px solid var(--c-outline); border-radius: 14px; background: linear-gradient(180deg, #5a47d6, #3c2ba0); box-shadow: 0 4px 0 var(--c-outline), inset 0 2px 0 rgba(255,255,255,.28); }
.preset:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--c-outline); }
.preset.active { background: linear-gradient(180deg, #ffe45a, #ff9a1f); }
.topup-field { margin-top: 6px; }
.topup-error { min-height: 22px; margin: 8px 0 4px; color: #ff8b80; font-size: 15px; }
.topup-ok { width: 100%; min-height: 56px; font-size: 26px; }
.topup-card .muted { margin-top: 10px; }

/* ---- medium widths: actions get their own row so nothing is squeezed ---- */
@media (max-width: 1189px) {
  #panel { grid-template-columns: 1fr 1fr; }
  .blk-actions { order: -1; grid-column: 1 / -1; }
}

/* ---- players drawer (only used on narrow screens) ---- */
.only-compact, .side-close, #sideBackdrop { display: none; }

@media (max-width: 1099px) {
  #layout { grid-template-columns: 1fr; }
  .only-compact { display: grid; }
  #side { position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 92vw); z-index: 60; border-radius: 22px 0 0 22px; transform: translateX(112%); transition: transform .25s ease; }
  #side.open { transform: translateX(0); }
  #sideBackdrop.show { display: block; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 55; background: rgba(8,3,32,.6); }
  .side-close { display: block; z-index: 2; }
  #tabs { margin-right: 52px; }
  #panel { grid-template-columns: 1fr 1fr; }
  .blk-actions { order: -1; grid-column: 1 / -1; }
}

/* ---- phones (portrait) ---- */
@media (max-width: 700px) {
  #app { padding: 0 8px 8px; }
  #topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; padding: 6px 0 8px; }
  .brand { min-width: 0; margin: 0; gap: 8px; }
  .brand img { width: 34px; height: 34px; }
  .logo-text { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .online { display: none; }
  .balance-pill { min-width: 0; padding: 3px 4px 3px 8px; gap: 6px; }
  .balance-pill .coin { width: 26px; height: 26px; }
  .bal-txt b { font-size: 20px; margin-top: 1px; }
  .bal-txt small { font-size: 10px; }
  .plus-btn { width: 32px; height: 32px; font-size: 22px; }
  .top-actions { grid-column: 1 / -1; justify-content: space-between; gap: 4px; }
  .icon-btn { width: 38px; height: 38px; border-radius: 12px; border-width: 3px; box-shadow: 0 4px 0 var(--c-outline), inset 0 2px 0 rgba(255,255,255,.3); }
  .icon-btn svg { width: 20px; height: 20px; }
  .icon-btn.gfx { min-width: 54px; font-size: 12px; padding: 0 6px; }
  #stage { border-width: 4px; border-radius: 20px; min-height: 120px; }
  #cv, #loader, #flash { border-radius: 16px; }
  #panel { grid-template-columns: 1fr; gap: 8px; padding: 10px; }
  .blk { gap: 5px; }
  .blk .lbl { display: none; }
  .auto-row .lbl { display: block; font-size: 12px; }
  .btn-big { min-height: 52px; font-size: 28px; padding: 6px; }
  .btn-cash .cash-label { font-size: 18px; }
  .btn-cash .cash-amt { font-size: 17px; }
  .round-actions { gap: 8px; }
  .bet-input { grid-template-columns: 42px 1fr 42px; gap: 6px; }
  .mini { font-size: 24px; border-width: 3px; border-radius: 12px; }
  .bet-field input, .auto-field input { font-size: 22px; padding: 3px 0; }
  .chips { display: none; }
  .quick .chip { font-size: 13px; padding: 3px 2px; min-width: 0; }
  .diffs { grid-template-columns: repeat(4, 1fr); gap: 5px; }
  .diff { padding: 4px 2px 3px; text-align: center; border-width: 3px; border-radius: 12px; }
  .diff::before { display: none; }
  .diff b { font-size: 14px; }
  .diff small { font-size: 10px; }
  .diff .dmax { display: none; }
  .auto-row { margin-top: 0; }
  .auto-field { width: 110px; border-width: 3px; }
  #multBox { top: 4px; }
  .mult-val { font-size: 32px; }
  .mult-sub .pill { font-size: 11px; padding: 0 6px; border-width: 2px; }
  #history { max-width: 22%; }
  .modal-card { padding: 18px 16px 18px; }
}
@media (max-width: 700px) and (max-height: 700px) {
  .quick, .auto-row { display: none; }
  .brand img { width: 30px; height: 30px; }
}
@media (max-width: 400px) {
  #btnFull { display: none; }
}

/* ---- phones / small windows in landscape: stage on the left, controls on the right ---- */
@media (max-height: 520px) and (min-width: 560px) {
  #app { padding: 0 8px 6px; }
  #topbar { display: flex; padding: 4px 0; gap: 6px; }
  .logo-text, .online, .bal-txt small { display: none; }
  .brand { margin-right: auto; }
  .icon-btn { width: 34px; height: 34px; }
  #gameCol { flex-direction: row; gap: 8px; }
  #stage { min-height: 0; }
  #panel { flex: 0 0 310px; grid-template-columns: 1fr; gap: 6px; padding: 8px; overflow-y: auto; }
  .blk .lbl, .chips, .quick, .auto-row { display: none; }
  .btn-big { min-height: 46px; font-size: 24px; }
  .diffs { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .diff { padding: 3px 2px; text-align: center; }
  .diff::before, .diff .dmax { display: none; }
  .diff b { font-size: 13px; }
  .mult-val { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01s !important; } }


/* ======================================================================
   Classes that replace every inline style (colours come from classes, never style="")
   ====================================================================== */
.is-invisible { visibility: hidden; }
#layout.layout-solo { grid-template-columns: 1fr; }
.tabs.two-tabs { grid-template-columns: 1fr 1fr; }
.empty-note { text-align: center; padding: 20px; }
.rules-sub { opacity: .8; font-size: 15px; }
.rules-h { color: var(--c-accent); }
.gl-error { text-align: center; padding: 24px; font-size: 22px; line-height: 1.4; }
.gl-error small { opacity: .8; }
.noscript-box { max-width: 520px; margin: 60px auto; padding: 24px; text-align: center; background: #3a2a8f; border: 4px solid #1b1244; border-radius: 22px; }
.noscript-box h2 { margin: 0 0 10px; color: #ffd426; font-weight: 400; }
/* avatar background / player-name colours (10 palette slots; JS picks the slot) */
.av-0 { background: #ff5a5f; }
.av-1 { background: #ff9f1c; }
.av-2 { background: #ffd426; }
.av-3 { background: #4cd964; }
.av-4 { background: #2ec4b6; }
.av-5 { background: #4dabf7; }
.av-6 { background: #7c5cff; }
.av-7 { background: #d96bff; }
.av-8 { background: #ff6bb5; }
.av-9 { background: #9be564; }
.nm-0 { color: #ff5a5f; }
.nm-1 { color: #ff9f1c; }
.nm-2 { color: #ffd426; }
.nm-3 { color: #4cd964; }
.nm-4 { color: #2ec4b6; }
.nm-5 { color: #4dabf7; }
.nm-6 { color: #7c5cff; }
.nm-7 { color: #d96bff; }
.nm-8 { color: #ff6bb5; }
.nm-9 { color: #9be564; }
/* progress bars in the live-bets list: pw-N = N x 5% */
.pw-0 { width: 0%; }
.pw-1 { width: 5%; }
.pw-2 { width: 10%; }
.pw-3 { width: 15%; }
.pw-4 { width: 20%; }
.pw-5 { width: 25%; }
.pw-6 { width: 30%; }
.pw-7 { width: 35%; }
.pw-8 { width: 40%; }
.pw-9 { width: 45%; }
.pw-10 { width: 50%; }
.pw-11 { width: 55%; }
.pw-12 { width: 60%; }
.pw-13 { width: 65%; }
.pw-14 { width: 70%; }
.pw-15 { width: 75%; }
.pw-16 { width: 80%; }
.pw-17 { width: 85%; }
.pw-18 { width: 90%; }
.pw-19 { width: 95%; }
.pw-20 { width: 100%; }
/* default difficulty colours (config.js can override them: a rule is generated from it) */
.diff[data-id="easy"] { --dc: #4cd964; --dc-dark: #316c52; }
.rules-h[data-id="easy"] { color: #4cd964; }
.diff[data-id="medium"] { --dc: #ffd426; --dc-dark: #826936; }
.rules-h[data-id="medium"] { color: #ffd426; }
.diff[data-id="hard"] { --dc: #ff9a1f; --dc-dark: #824f33; }
.rules-h[data-id="hard"] { color: #ff9a1f; }
.diff[data-id="hardcore"] { --dc: #ff4a3d; --dc-dark: #822b41; }
.rules-h[data-id="hardcore"] { color: #ff4a3d; }
