/* Wspólne dla całego kasyna: paleta, pasek górny, przyciski. */

:root {
  --felt-light: #16704c;
  --felt: #0c5136;
  --felt-dark: #052318;
  --rail: #2b1a12;
  --rail-light: #4a2e1f;
  --gold: #d8b45a;
  --gold-bright: #f4dc9a;
  --gold-dim: #8a7038;
  --ink: #f3ece0;
  --ink-dim: #a99f8e;
  --win: #57d98a;
  --lose: #e8695f;
  --push: #d8c07a;
  --radius: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: #120c08;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

.app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* ------------------------------------------------------------- górny pasek */

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: linear-gradient(180deg, var(--rail-light), var(--rail));
  border-bottom: 2px solid rgba(0, 0, 0, .6);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .5);
  z-index: 5;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.brand__mark {
  font-size: 20px;
  color: var(--gold-bright);
  text-shadow: 0 0 16px rgba(216, 180, 90, .5);
}

.brand__sub {
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: .3em;
}

.brand__back {
  align-self: center;
  margin-right: 2px;
  padding: 2px 10px 4px;
  border-radius: 8px;
  border: 1px solid rgba(216, 180, 90, .28);
  background: rgba(0, 0, 0, .3);
  color: var(--ink-dim);
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
  transition: color .15s, border-color .15s;
}

.brand__back:hover { color: var(--gold-bright); border-color: var(--gold); }

.stats {
  display: flex;
  gap: 10px;
  align-items: center;
}

.stat {
  min-width: 104px;
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .32);
  border: 1px solid rgba(216, 180, 90, .28);
  text-align: right;
  line-height: 1.25;
}

.stat__label {
  display: block;
  font-size: 9px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat__value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 17px;
  color: var(--gold-bright);
}

.stat--balance.is-up .stat__value { color: var(--win); }
.stat--balance.is-down .stat__value { color: var(--lose); }

.iconbtn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(216, 180, 90, .28);
  background: rgba(0, 0, 0, .32);
  color: var(--ink-dim);
  font-size: 15px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}

.iconbtn:hover { color: var(--gold-bright); border-color: var(--gold); }
.iconbtn.is-off { opacity: .45; }

.iconbtn--small {
  width: 24px;
  height: 24px;
  font-size: 13px;
  border-radius: 6px;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

/* ---------------------------------------------------------------- przyciski */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .04));
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s, filter .12s, opacity .12s;
}

.btn:hover:not(:disabled):not(.is-disabled) { transform: translateY(-2px); filter: brightness(1.18); }
.btn:active:not(:disabled):not(.is-disabled) { transform: translateY(0); }

.btn:disabled,
.btn.is-disabled {
  opacity: .3;
  cursor: not-allowed;
  pointer-events: none;
}

.btn__key {
  display: inline-block;
  margin-left: 8px;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .35);
  font-size: 10px;
  opacity: .65;
}

.btn--primary {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-dim));
  border-color: var(--gold-bright);
  color: #241a05;
}

.btn--hit { background: linear-gradient(180deg, #2f9b5f, #17603a); border-color: #3fbd77; }
.btn--stand { background: linear-gradient(180deg, #c9564c, #8a2f28); border-color: #e8695f; }
.btn--double { background: linear-gradient(180deg, #4a7fd0, #27508f); border-color: #6fa0e8; }
.btn--split { background: linear-gradient(180deg, #8b4fbf, #522877); border-color: #ab74dd; }
.btn--ghost { background: rgba(255, 255, 255, .06); }

.btn--wide { width: 100%; }

.btn--small {
  min-width: 0;
  padding: 7px 12px;
  font-size: 11px;
}

/* ---------------------------------------------------------------- formularz */

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field__label {
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.field__input {
  padding: 11px 13px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(0, 0, 0, .35);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
}

.field__input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(216, 180, 90, .16);
}

.field__input--code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 19px;
  letter-spacing: .22em;
  text-align: center;
  text-transform: uppercase;
}

.field__hint {
  font-size: 11px;
  color: var(--ink-dim);
}

.alert {
  margin: 0 0 14px;
  padding: 10px 13px;
  border-radius: 9px;
  background: rgba(160, 40, 34, .25);
  border: 1px solid rgba(232, 105, 95, .5);
  font-size: 13px;
  color: #ffd9d5;
}

.alert--good {
  background: rgba(40, 120, 70, .25);
  border-color: rgba(87, 217, 138, .5);
  color: #d6ffe6;
}

/* ------------------------------------------------------------- panel gracza */

.hud {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 20px 16px;
  background: linear-gradient(180deg, var(--rail), #1d110b);
  border-top: 2px solid rgba(216, 180, 90, .3);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, .5);
  z-index: 5;
}

.hud__hint {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  min-height: 14px;
  text-align: center;
}

.hud__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hud__row[hidden] { display: none; }

.chips {
  display: flex;
  align-items: center;
  gap: 8px;
}



/* ------------------------------------------------------------------ żetony */

.chip {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
  background: var(--chip, #555);
  box-shadow:
    0 4px 0 rgba(0, 0, 0, .35),
    0 8px 16px rgba(0, 0, 0, .45),
    inset 0 0 0 4px rgba(255, 255, 255, .18),
    inset 0 0 0 5px rgba(0, 0, 0, .25);
  transition: transform .12s, box-shadow .12s, filter .12s;
}

.chip::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, .35);
}

.chip:hover:not(:disabled) { transform: translateY(-4px); }
.chip:active:not(:disabled) { transform: translateY(0); box-shadow: 0 2px 0 rgba(0,0,0,.35), inset 0 0 0 4px rgba(255,255,255,.18); }
.chip:disabled { filter: grayscale(.7) brightness(.6); cursor: not-allowed; }

.chip--10 { --chip: linear-gradient(150deg, #4a5a68, #2b3843); }
.chip--25 { --chip: linear-gradient(150deg, #2f9b5f, #16613a); }
.chip--100 { --chip: linear-gradient(150deg, #3a3a44, #16161c); }
.chip--500 { --chip: linear-gradient(150deg, #8b4fbf, #4d2570); }
.chip--1000 { --chip: linear-gradient(150deg, #d8b45a, #8a6b1f); color: #241a05; text-shadow: none; }



/* ------------------------------------------------------------------- zegar */

.hud__clock {
  width: min(420px, 90%);
  height: 3px;
  border-radius: 2px;
  background: rgba(0, 0, 0, .4);
  overflow: hidden;
}

.hud__clock-bar {
  height: 100%;
  width: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  transform-origin: left;
  transition: transform .3s linear;
}

.hud__clock.is-urgent .hud__clock-bar {
  background: linear-gradient(90deg, #a8332b, var(--lose));
}

@media (max-width: 860px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .brand { white-space: nowrap; }
  .brand__mark { font-size: 15px; letter-spacing: .1em; }
  .brand__sub { display: none; }
  .stat { min-width: 78px; padding: 4px 9px; }
  .stat__value { font-size: 15px; }
  .stat__label { max-width: 72px; }
}
