/* Coin Flip — game-specific layout and coin treatment using Casino Felt tokens. */

#app {
  width: 100%;
  height: 100vh;
  height: 100dvh;
}

.coin-app {
  width: min(100%, 426px);
  height: 100%;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 18px max(12px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.coin-header,
.brand,
.header-actions {
  display: flex;
  align-items: center;
}

.coin-header {
  flex: 0 0 auto;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 1px 2px;
}

.brand { gap: 9px; min-width: 0; }
.brand__mark {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--cf-die-hi), var(--cf-die-lo));
  color: var(--cf-ink-900);
  font-size: 17px;
  font-weight: var(--cf-fw-heavy);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.32), inset 0 2px 0 rgba(255, 255, 255, 0.8);
}
.brand__copy { min-width: 0; }
.brand__copy .cf-eyebrow {
  color: var(--cf-fg-on-felt-muted);
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.brand h1 {
  margin: 2px 0 0;
  color: var(--cf-fg-on-felt);
  font-size: 19px;
  line-height: 1.15;
  font-weight: 750;
}

.header-actions { gap: 8px; flex: 0 0 auto; }
.score-readout {
  min-width: 76px;
  padding: 6px 10px;
  align-items: flex-end;
  gap: 0;
  border-radius: var(--cf-radius-md);
  box-shadow: var(--cf-shadow-paper-sm);
  text-align: right;
}
.score-readout .cf-readout__label {
  color: var(--cf-fg-muted);
  font-size: 9px;
  line-height: 1.3;
  letter-spacing: 0.1em;
}
.score-readout .cf-readout__value {
  color: var(--cf-fg);
  font-size: 23px;
  line-height: 1.1;
}
.restart-button {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: var(--cf-radius-md);
}
.restart-button svg { display: block; }

.coin-table {
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 18px 17px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.table-label {
  width: 100%;
  min-height: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--cf-fg-on-felt-muted);
  font-size: 10px;
  line-height: 1.3;
  font-weight: var(--cf-fw-bold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.table-label .cf-badge {
  min-height: 24px;
  padding: 3px 9px;
  font-size: 9px;
  letter-spacing: 0.1em;
}

.coin-wrap {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 17px;
}
.coin {
  flex: 0 0 auto;
  width: clamp(138px, 42vw, 170px);
  height: clamp(138px, 42vw, 170px);
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 50%;
  background: radial-gradient(circle at 33% 27%, var(--cf-die-hi) 0, var(--cf-die) 52%, #d9d6c8 100%);
  color: var(--cf-ink-900);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.32),
              0 22px 34px rgba(0, 0, 0, 0.34),
              inset 0 2px 0 var(--cf-die-hi),
              inset 0 -4px 0 rgba(0, 0, 0, 0.14);
}
.coin::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 2px solid #b4aa8d;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.5);
}
.coin__face { position: relative; display: flex; flex-direction: column; align-items: center; }
.coin__mark {
  font-size: clamp(35px, 10vw, 43px);
  line-height: 1;
  font-weight: var(--cf-fw-heavy);
  letter-spacing: -0.08em;
}
.coin__mark--result { font-size: 40px; }
.coin__caption {
  margin-top: 6px;
  color: var(--cf-ink-500);
  font-size: 9px;
  line-height: 1.2;
  font-weight: var(--cf-fw-heavy);
  letter-spacing: 0.19em;
}

.result-copy { max-width: 100%; }
.prompt {
  margin: 0;
  color: var(--cf-fg-on-felt);
  font-size: 18px;
  line-height: 1.3;
  font-weight: var(--cf-fw-bold);
}
.hint {
  margin: 5px 0 0;
  color: var(--cf-fg-on-felt-muted);
  font-size: 13px;
  line-height: 1.4;
}

.guess-controls { flex: 0 0 auto; width: 100%; margin-top: auto; }
.guess-label {
  margin: 0 0 9px;
  color: var(--cf-fg-on-felt-muted);
  font-size: 10px;
  line-height: 1.3;
  font-weight: var(--cf-fw-bold);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.choices {
  width: 100%;
  padding: 4px;
  gap: 6px;
  border-radius: 13px;
}
.choices .cf-segmented__opt {
  flex: 1 1 0;
  min-height: 46px;
  padding: 10px 8px;
  border-radius: 9px;
  font-size: 14px;
  touch-action: manipulation;
}
.choices .cf-segmented__opt:focus-visible {
  outline: 2px solid var(--cf-gold-300);
  outline-offset: 2px;
}
.flip-button {
  width: 100%;
  min-height: 52px;
  margin-top: 13px;
  border-radius: var(--cf-radius-md);
  letter-spacing: 0.01em;
  touch-action: manipulation;
}

.coin-footer {
  flex: 0 0 auto;
  margin: 0;
  min-height: 14px;
  color: var(--cf-fg-on-felt-muted);
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
}
.coin-footer strong { color: var(--cf-fg-on-felt); font-weight: var(--cf-fw-bold); }

@media (max-width: 360px) {
  .coin-app { gap: 9px; padding-right: 14px; padding-left: 14px; }
  .coin-header { gap: 5px; }
  .brand { gap: 7px; }
  .brand__mark { flex-basis: 32px; width: 32px; height: 32px; }
  .brand__copy .cf-eyebrow { font-size: 9px; letter-spacing: 0.08em; }
  .score-readout { min-width: 70px; padding-right: 8px; padding-left: 8px; }
  .header-actions { gap: 6px; }
}

@media (max-height: 650px) {
  .coin-app { gap: 8px; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .coin-table { padding: 13px 16px 14px; }
  .coin-wrap { padding: 8px 0; gap: 12px; }
  .coin { width: clamp(124px, 27vh, 148px); height: clamp(124px, 27vh, 148px); }
  .coin__mark--result { font-size: 36px; }
  .flip-button { margin-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
