/* Modern Glassmorphism + Responsive UI for Rock-Paper-Scissors */

:root {
  --bg: radial-gradient(1200px 800px at 10% 10%, #1f3b4d 0%, rgba(31,59,77,0) 55%),
        radial-gradient(900px 700px at 90% 20%, #3b82f6 0%, rgba(59,130,246,0) 50%),
        radial-gradient(1200px 800px at 40% 90%, #14b8a6 0%, rgba(20,184,166,0) 55%),
        linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
  --glass-bg: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.22);
  --glass-hover: rgba(255, 255, 255, 0.18);
  --text: #e6f2f7;
  --muted: #c3d7df;
  --accent: #7dd3fc;
  --accent-strong: #38bdf8;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --blur: 12px;
  --shadow-ambient: 0 12px 40px rgba(0, 0, 0, 0.35);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.18),
                   inset 0 -8px 20px rgba(0, 0, 0, 0.18);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  background-attachment: fixed;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 28px);
}

/* Glass card shell */
.app-shell {
  width: min(920px, 96vw);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  box-shadow: var(--shadow-ambient);
  padding: clamp(16px, 4vw, 28px);
}

/* Header / Title */
.app-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: clamp(12px, 3vw, 20px);
}

.title {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  font-size: clamp(20px, 4.8vw, 34px);
  line-height: 1.2;
  color: transparent;
  background: linear-gradient(90deg, #ffffff 0%, var(--accent) 50%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,0.25));
}

/* Controls: buttons area */
.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(90px, 100%), 1fr));
  gap: clamp(12px, 3.2vw, 20px);
  align-items: center;
  justify-content: center;
  margin: clamp(12px, 3.2vw, 20px) 0 clamp(14px, 3.6vw, 22px);
}

/* Move buttons - glass, tactile */
.move-button {
  position: relative;
  isolation: isolate;
  width: clamp(92px, 28vw, 140px);
  height: clamp(92px, 28vw, 140px);
  border-radius: var(--radius-md);
  background: linear-gradient(165deg, rgba(255,255,255,0.16), rgba(255,255,255,0.08));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-inset), 0 8px 24px rgba(0,0,0,0.25);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
  backdrop-filter: blur(calc(var(--blur) / 2));
  -webkit-backdrop-filter: blur(calc(var(--blur) / 2));
  outline: none;
}

.move-button:hover {
  transform: translateY(-4px) scale(1.03);
  background: linear-gradient(165deg, var(--glass-hover), rgba(255,255,255,0.1));
  box-shadow: var(--shadow-inset), 0 14px 32px rgba(0,0,0,0.35);
}

.move-button:active {
  transform: translateY(0) scale(0.98);
  box-shadow: var(--shadow-inset), 0 6px 16px rgba(0,0,0,0.28);
}

.move-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.45), 0 12px 28px rgba(0,0,0,0.35);
}

/* Icon sizing: smaller in status, larger in buttons */
.move-icon {
  display: block;
  width: clamp(36px, 8vw, 56px);
  height: clamp(36px, 8vw, 56px);
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.35));
  user-select: none;
  pointer-events: none;
}

.controls .move-icon {
  width: clamp(56px, 12vw, 84px);
  height: clamp(56px, 12vw, 84px);
}

/* Status area */
.status {
  display: grid;
  gap: 8px;
  margin: clamp(8px, 2.4vw, 14px) 0 clamp(14px, 3vw, 18px);
  text-align: center;
}

.show-moves {
  margin: 0;
  color: var(--muted);
  font-size: clamp(14px, 3.6vw, 16px);
  min-height: 24px;
}

.show-result {
  margin: 2px 0 0;
  font-size: clamp(18px, 4.2vw, 22px);
  font-weight: 700;
  color: red;
  text-shadow: 0 1px 10px rgba(56, 189, 248, 0.25);
}

.show-score {
  margin: 4px 0 0;
  font-size: clamp(14px, 3.4vw, 16px);
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* Actions */
.actions {
  display: flex;
  justify-content: center;
  margin-top: clamp(12px, 3.2vw, 18px);
}

/* Reset score button - glass pill */
.reset-score-button,
.autoplay-score-button {
  appearance: none;
  border: 1px solid rgba(239, 68, 68, 0.55);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.28), rgba(239, 68, 68, 0.18));
  color: #fee2e2;
  font-size: clamp(14px, 3.4vw, 15px);
  font-weight: 600;
  padding: clamp(10px, 2.6vw, 12px) clamp(16px, 4vw, 20px);
  border-radius: var(--radius-pill);
  cursor: pointer;
  backdrop-filter: blur(calc(var(--blur) / 2));
  -webkit-backdrop-filter: blur(calc(var(--blur) / 2));
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.25), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.reset-score-button:hover
.autoplay-score-button:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.34), rgba(239, 68, 68, 0.22));
  box-shadow: 0 10px 22px rgba(239, 68, 68, 0.34);
}

.reset-score-button:active,
.autoplay-score-button:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.25);
}

.reset-score-button:focus-visible,
.autoplay-score-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.45), 0 10px 22px rgba(239, 68, 68, 0.34);
}

/* Legacy selector kept (not used) */
.score {
  margin-top: 24px;
}

/* Responsive tweaks */
@media (min-width: 480px) {
  .controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(14px, 3vw, 22px);
  }
}

@media (min-width: 768px) {
  .app-shell {
    padding: clamp(20px, 3.6vw, 32px);
  }
  .controls {
    gap: 22px;
  }
}

/* Motion sensitivity */
@media (prefers-reduced-motion: reduce) {
  .move-button,
  .reset-score-button,.autoplay-score-button {
    transition: none;
  }
}
