/* Panache — common styles shared by splash, game shell, two-player */

:root {
  --bg: #1a1014;
  --bg-card: #2b1c22;
  --bg-card-2: #1f1318;
  --fg: #f5e9d4;
  --gold: #f0c14b;
  --gold-soft: rgba(240, 193, 75, 0.18);
  --gold-mid: rgba(240, 193, 75, 0.45);
  --hot: #d36d6d;
  --cold: #6d9dd3;
  --good: #6dd38a;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: Georgia, "Times New Roman", serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overflow: hidden;
}

button, input {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  background: transparent;
  border: 1.5px solid var(--gold-mid);
  color: var(--gold);
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.1s ease;
}
button:hover:not(:disabled) {
  background: rgba(240, 193, 75, 0.08);
  border-color: var(--gold);
}
button:active:not(:disabled) { transform: scale(0.98); }
button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
button.primary {
  background: var(--gold);
  color: #1a1014;
  border-color: var(--gold);
  font-weight: bold;
}
button.primary:hover:not(:disabled) {
  background: #ffd76a;
  border-color: #ffd76a;
}
button.ghost {
  border-color: rgba(245, 233, 212, 0.25);
  color: var(--fg);
}

input[type="text"] {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--gold-soft);
  color: var(--fg);
  padding: 14px 16px;
  border-radius: 10px;
  width: 100%;
  outline: none;
  transition: border-color 0.18s ease;
}
input[type="text"]:focus { border-color: var(--gold); }

.title {
  font-size: 2.2rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
  margin: 0;
  font-weight: normal;
}

.subtitle {
  text-align: center;
  font-style: italic;
  opacity: 0.65;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

/* === Score animations (broadcast on score:click) === */
.score-fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
  overflow: hidden;
}
.score-fx-num {
  position: absolute;
  font-size: 4rem;
  font-weight: bold;
  font-family: Georgia, serif;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
  animation: scoreFly 1.2s cubic-bezier(0.2, 0.6, 0.2, 1) forwards;
  transform: translate(-50%, -50%);
}
.score-fx-num.pos { color: var(--good); }
.score-fx-num.neg { color: var(--hot); }
@keyframes scoreFly {
  0%   { opacity: 0; transform: translate(-50%, -30%) scale(0.6); }
  18%  { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -180%) scale(0.85); }
}
.score-fx-label {
  position: absolute;
  left: 50%;
  top: 30%;
  transform: translateX(-50%);
  text-align: center;
  font-style: italic;
  font-size: clamp(1.1rem, 4vw, 1.6rem);
  padding: 14px 28px;
  background: rgba(26, 16, 20, 0.85);
  border: 1px solid var(--gold-soft);
  border-radius: 14px;
  max-width: 80vw;
  animation: labelPulse 2.4s ease forwards;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.score-fx-label.pos { color: var(--good); border-color: rgba(109, 211, 138, 0.4); }
.score-fx-label.neg { color: var(--hot);  border-color: rgba(211, 109, 109, 0.4); }
@keyframes labelPulse {
  0%, 100% { opacity: 0; transform: translateX(-50%) scale(0.95); }
  10%, 75% { opacity: 1; transform: translateX(-50%) scale(1); }
}

/* === Tomato (negative-score round end) === */
.tomato-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9100;
  overflow: hidden;
}
.tomato {
  position: absolute;
  left: 50%;
  top: -120px;
  width: 180px;
  height: 180px;
  margin-left: -90px;
  animation: tomatoDrop 0.55s cubic-bezier(0.6, 0, 0.95, 0.4) forwards;
}
@keyframes tomatoDrop {
  0%   { top: -180px; transform: rotate(-8deg) scale(0.9); }
  100% { top: 38%;     transform: rotate(15deg) scale(1.05); }
}
.tomato-splat {
  position: absolute;
  left: 50%;
  top: 38%;
  width: 320px;
  height: 320px;
  margin-left: -160px;
  margin-top: -40px;
  opacity: 0;
  animation: splatAppear 0.25s ease 0.5s forwards;
}
@keyframes splatAppear {
  to { opacity: 1; }
}
.tomato-drip {
  position: absolute;
  left: 50%;
  top: 38%;
  margin-left: -100px;
  width: 200px;
  opacity: 0;
  animation: dripDown 1.6s ease 0.6s forwards;
}
@keyframes dripDown {
  0%   { opacity: 1; transform: scaleY(0); transform-origin: top center; }
  100% { opacity: 0.85; transform: scaleY(1); transform-origin: top center; }
}
.tomato-msg {
  position: absolute;
  left: 50%;
  bottom: 20%;
  transform: translateX(-50%);
  color: #ff8a8a;
  font-style: italic;
  font-size: clamp(1.1rem, 4.5vw, 1.5rem);
  text-shadow: 0 2px 10px rgba(0,0,0,0.7);
  text-align: center;
  opacity: 0;
  animation: tomatoMsg 2.5s ease 0.8s forwards;
}
@keyframes tomatoMsg {
  0%, 100% { opacity: 0; }
  20%, 80% { opacity: 1; }
}

/* === Spinner / utility === */
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--gold-soft);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
