:root {
  color-scheme: dark;
  --ink: #f7f4e8;
  --muted: #aaa99f;
  --gold: #f2c14e;
  --panel: #171b25;
  --line: #313747;
}
* {
  box-sizing: border-box;
}
button,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(
    circle at 50% 0,
    #28304a 0,
    #10131b 45%,
    #080a0f 100%
  );
  color: var(--ink);
  font:
    16px/1.5 ui-rounded,
    'SF Pro Rounded',
    system-ui,
    sans-serif;
}
.app {
  width: min(800px, 100%);
  margin: auto;
  padding: 18px clamp(14px, 4vw, 34px) 40px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 24px;
}
header > a,
header button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #151923;
  color: white;
  text-decoration: none;
  font-size: 20px;
}
.brand {
  text-align: center;
  letter-spacing: 0.16em;
}
.brand b {
  display: block;
  color: var(--gold);
  font-size: 18px;
}
.brand span {
  font-size: 10px;
  color: var(--muted);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}
.header-actions select {
  width: auto;
  min-width: 58px;
  height: 42px;
  margin: 0;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #151923;
  color: #fff;
  font-size: 12px;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 30px;
  background: linear-gradient(145deg, #1d2230, #11151d);
  box-shadow: 0 30px 90px #0008;
}
.intro {
  padding: clamp(28px, 7vw, 60px);
  text-align: center;
}
.mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 140px;
  height: 140px;
  margin: auto;
  border: 4px double var(--gold);
  border-radius: 28px;
  transform: rotate(3deg);
  background: #232a39;
  color: var(--gold);
  font:
    900 58px Georgia,
    serif;
  box-shadow: 0 0 50px #f2c14e25;
}
.mark span {
  font-size: 25px;
}
.mark span:last-child {
  color: #df4c4c;
}
.kicker {
  margin-top: 30px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
}
.intro h1 {
  margin: 6px 0;
  font-size: clamp(32px, 7vw, 52px);
}
.intro > p:not(.kicker) {
  max-width: 540px;
  margin: 8px auto 28px;
  color: var(--muted);
}
label {
  display: block;
  max-width: 440px;
  margin: 0 auto 18px;
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
label select {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0d1017;
  color: #fff;
  font-size: 16px;
}
.primary {
  min-height: 52px;
  padding: 0 28px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, #ffe08a, #d99b25);
  color: #17120a;
  font-weight: 900;
  font-size: 16px;
}
.intro small {
  display: block;
  margin-top: 20px;
  color: #85877f;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.stats div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #151923;
  text-align: center;
}
.stats span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.13em;
}
.stats b {
  font-size: 20px;
  color: var(--gold);
}
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(8px, 2vw, 16px);
  max-width: 680px;
  margin: auto;
}
.poker-card {
  position: relative;
  aspect-ratio: 2.5/3.5;
  min-width: 0;
  border: 2px solid #ddd6c8;
  border-radius: clamp(10px, 2vw, 18px);
  background: linear-gradient(145deg, #fffef9, #e8e3d8);
  color: #171719;
  box-shadow:
    0 9px 0 #8c887e,
    0 15px 30px #0005;
  transition:
    transform 0.15s,
    opacity 0.15s;
}
.poker-card:hover:not(:disabled) {
  transform: translateY(-7px);
}
.poker-card.red {
  color: #cf2f3b;
}
.poker-card.used {
  opacity: 0.25;
  transform: scale(0.94);
  box-shadow: 0 4px 0 #69665e;
  cursor: default;
}
.corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.9;
  font-family: Georgia, serif;
}
.corner b {
  font-size: clamp(20px, 5vw, 38px);
}
.corner i {
  font-size: clamp(16px, 3vw, 25px);
  font-style: normal;
}
.corner.top {
  top: 10px;
  left: 10px;
}
.corner.bottom {
  right: 10px;
  bottom: 10px;
  transform: rotate(180deg);
}
.center-suit {
  font-size: clamp(42px, 10vw, 78px);
}
.expression-panel {
  margin: 30px auto 16px;
  max-width: 650px;
}
.expression-label {
  display: block;
  margin-bottom: 7px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}
.expression {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 12px 16px;
  overflow-wrap: anywhere;
  border: 1px solid #465067;
  border-radius: 16px;
  background: #0b0e14;
  color: #fff;
  text-align: center;
  font:
    700 clamp(20px, 5vw, 32px) Georgia,
    serif;
}
.expression.empty {
  color: #737782;
  font:
    500 15px/1.4 system-ui,
    sans-serif;
}
.keypad {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  max-width: 650px;
  margin: 0 auto 16px;
}
.keypad button {
  min-height: 50px;
  padding: 4px;
  border: 1px solid #596174;
  border-radius: 13px;
  background: #202635;
  color: var(--gold);
  font-size: 24px;
  font-weight: 800;
}
.keypad button:last-child {
  color: #ddd;
  font-size: 13px;
}
.check {
  display: block;
  width: min(260px, 100%);
  margin: 0 auto;
  font-size: 20px;
}
.message {
  min-height: 30px;
  margin: 14px 0 8px;
  text-align: center;
  color: #dcd7c7;
}
.message.error {
  color: #ff8d8d;
}
.message.success {
  color: #87e8a7;
}
.message.hint {
  color: #ffe08a;
}
.tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.tools button {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #151923;
  color: #d7d6cf;
}
aside {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding: 15px;
  border-left: 3px solid var(--gold);
  background: #f2c14e0c;
  color: var(--muted);
  font-size: 13px;
}
aside b {
  white-space: nowrap;
  color: var(--gold);
}
.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #05070ad9;
  backdrop-filter: blur(10px);
}
.modal[hidden] {
  display: none;
}
.modal > div {
  width: min(420px, 100%);
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #171b25;
  text-align: center;
}
.trophy {
  font-size: 58px;
}
.modal h2 {
  font-size: 30px;
}
.modal p b {
  color: var(--gold);
  font-size: 24px;
}
@media (max-width: 600px) {
  .app {
    padding-top: 10px;
  }
  .stats {
    margin-bottom: 18px;
  }
  .poker-card {
    aspect-ratio: 2.35/3.5;
  }
  .corner.top {
    top: 6px;
    left: 6px;
  }
  .corner.bottom {
    right: 6px;
    bottom: 6px;
  }
  .keypad {
    grid-template-columns: repeat(4, 1fr);
  }
  .expression-panel {
    margin-top: 25px;
  }
  aside {
    display: block;
  }
  aside b {
    display: block;
    margin-bottom: 5px;
  }
}
@media (max-width: 360px) {
  .brand {
    letter-spacing: 0.08em;
  }
  .header-actions select {
    min-width: 50px;
  }
  .cards {
    gap: 6px;
  }
  .center-suit {
    font-size: 35px;
  }
}
