/* Global Styles */
:root {
  --bg: #ffffff;
  --text: #0f172a; /* slate-900 */
  --muted: #475569; /* slate-600 */
  --accent: #2563eb; /* blue-600 */
  --ring: rgba(37, 99, 235, 0.25);
  --card: #f8fafc; /* slate-50 */
  --border: #e2e8f0; /* slate-200 */
  --win: #16a34a; /* green-600 */
  --lose: #dc2626; /* red-600 */
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 48px;
  display: grid;
  gap: 24px;
}

.header h1 {
  margin: 0 0 4px 0;
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 800;
}
.subtitle {
  margin: 0;
  color: var(--muted);
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.score {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.score .label {
  color: var(--muted);
  font-weight: 600;
}
.score .value {
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 800;
}

.arena {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: clamp(16px, 3vw, 28px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  justify-items: center;
  gap: clamp(8px, 2vw, 24px);
}

.vs {
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 2px;
}

.hand {
  font-size: clamp(72px, 12vw, 140px); /* BIG hands */
  transition: transform 140ms ease, filter 200ms ease;
  filter: drop-shadow(0 4px 12px rgba(15, 23, 42, 0.08));
}
.hand.reveal {
  animation: pop 220ms ease;
}
@keyframes pop {
  from { transform: scale(0.9); opacity: 0.8; }
  to   { transform: scale(1);   opacity: 1; }
}

.result {
  text-align: center;
  font-size: clamp(16px, 2.5vw, 22px);
  margin: 0;
  min-height: 1.6em;
}
.result.win { color: var(--win); }
.result.lose { color: var(--lose); }

.controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.choice {
  font-size: clamp(32px, 6vw, 56px); /* BIG buttons */
  line-height: 1;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: white;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.choice:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.08);
  border-color: #cbd5e1; /* slate-300 */
}
.choice:active {
  transform: translateY(0);
}

.reset {
  margin-top: 6px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}
.reset:hover {
  box-shadow: 0 6px 14px var(--ring);
}

.footer {
  display: flex;
  justify-content: center;
}

/* Toolbar and History */
.toolbar {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.history-toggle {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}
.history-toggle:hover {
  box-shadow: 0 6px 14px var(--ring);
}

/* Tone picker */
.tone-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.tone-label {
  color: var(--muted);
  font-size: 14px;
}
.tone-btn {
  font-size: 20px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  cursor: pointer;
}
.tone-btn[aria-pressed="true"] {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.history {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}
.history-title {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: var(--muted);
}
.history-list {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 6px;
}
.history-list li {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
}
