* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #1a472a;
  color: #fff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#app {
  width: 100%;
  max-width: 480px;
  padding: 16px;
}

.screen {
  text-align: center;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 0.25rem;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.subtitle {
  color: #8fbc8f;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

/* Buttons & Inputs */

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-primary {
  background: #2d8a4e;
  color: #fff;
}

.btn-primary:hover {
  background: #3da564;
}

.btn-primary:active {
  background: #247a42;
}

.input {
  padding: 10px 14px;
  border: 2px solid #3a6b3a;
  border-radius: 8px;
  font-size: 1rem;
  background: #0d2818;
  color: #fff;
  width: 100%;
  margin-bottom: 12px;
}

.input:focus {
  outline: none;
  border-color: #2d8a4e;
}

/* Share link */

.share-link {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.share-link .input {
  flex: 1;
  margin-bottom: 0;
}

.share-link .btn {
  background: #3a6b3a;
  color: #fff;
  white-space: nowrap;
}

/* Game board */

#game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

#turn-info {
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 600;
}

#turn-info.my-turn {
  background: #2d8a4e;
}

#turn-info.their-turn {
  background: #555;
}

.player-label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #8fbc8f;
}

/* Card grid */

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

/* Cards */

.card {
  width: 100%;
  aspect-ratio: 2.5/3.5;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  cursor: default;
  user-select: none;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
}

.card-face {
  background: #fff;
  color: #222;
  border: 2px solid #ccc;
}

.card-face.negative {
  background: #ffd700;
  color: #222;
  border-color: #daa520;
}

.card-face.zero {
  background: #b0e0b0;
  color: #222;
  border-color: #6aaa6a;
}

.card-face.high {
  background: #ffcccc;
  color: #8b0000;
  border-color: #cc8888;
}

.card-back {
  background: linear-gradient(135deg, #1a5276, #2980b9);
  border: 2px solid #5dade2;
  color: #fff;
  font-size: 0.75rem;
}

.card-empty {
  background: rgba(255,255,255,0.1);
  border: 2px dashed rgba(255,255,255,0.3);
}

.card.clickable {
  cursor: pointer;
}

.card.clickable:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.card.selected {
  box-shadow: 0 0 0 3px #ffd700;
  transform: translateY(-3px);
}

/* Center area */

#center-area {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

#center-area .card {
  width: 70px;
  height: 98px;
  flex-shrink: 0;
}

#drawn-card {
  border: 3px solid #ffd700;
}

/* Action hint */

.hint {
  text-align: center;
  font-size: 0.9rem;
  color: #8fbc8f;
  min-height: 1.5rem;
  margin-top: 8px;
}

/* Score screens */

#score-table, #final-scores {
  margin: 20px 0;
}

.score-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.score-row.header {
  font-weight: 700;
  border-bottom: 2px solid rgba(255,255,255,0.3);
}

.score-row .name {
  flex: 1;
  text-align: left;
}

.score-row .score {
  width: 60px;
  text-align: right;
}

.winner {
  color: #ffd700;
  font-weight: 700;
}

/* Responsive */

@media (max-width: 360px) {
  .card {
    font-size: 1.1rem;
  }

  #center-area .card {
    width: 60px;
    height: 84px;
  }
}
