* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #0d1b2a; font-family: Georgia, serif; color: #e0d8c8; min-height: 100vh; }
#app { max-width: 480px; margin: 0 auto; padding: 12px; }

h1 { text-align: center; font-size: 1.8em; margin-bottom: 2px; }
h1 .am { color: #d4a017; }
h1 .en { color: #e0d8c8; font-size: 0.6em; }
.subtitle { text-align: center; color: #6a7a8a; font-size: 0.85em; margin-bottom: 16px; }

.panel {
  background: #152238; border: 1px solid #253858; border-radius: 14px;
  padding: 18px; margin-bottom: 14px;
}
.panel h3 { color: #d4a017; margin-bottom: 10px; }

input {
  width: 100%; padding: 10px 14px; border: 2px solid #253858; border-radius: 8px;
  background: #0d1b2a; color: #e0d8c8; font: 15px Georgia; outline: none; margin-bottom: 8px;
}
input:focus { border-color: #d4a017; }

button {
  padding: 10px 20px; border: none; border-radius: 8px; font: bold 14px Georgia;
  cursor: pointer; transition: all 0.2s;
}
button:hover { opacity: 0.85; transform: scale(1.02); }
button:disabled { opacity: 0.35; cursor: default; transform: none; }

.btn-green { background: #078930; color: #fff; }
.btn-gold { background: #d4a017; color: #0d1b2a; }
.btn-red { background: #c0392b; color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

.row { display: flex; gap: 8px; margin-bottom: 8px; }
.row > * { flex: 1; }

.status { text-align: center; color: #6a7a8a; font-size: 13px; padding: 6px 0; }
.error { color: #c0392b; text-align: center; font-size: 13px; }

/* Scoreboard */
.scores {
  display: flex; justify-content: center; gap: 30px; margin: 12px 0;
}
.score-box {
  text-align: center; padding: 10px 20px; border-radius: 10px;
  background: #1a2d47; min-width: 100px;
}
.score-box.active { border: 2px solid #d4a017; box-shadow: 0 0 15px rgba(212,160,23,0.2); }
.score-box .name { font-size: 13px; color: #8a9aaa; margin-bottom: 4px; }
.score-box .pts { font-size: 28px; font-weight: bold; color: #d4a017; }
.score-box.you .name { color: #078930; }

/* Round info */
.round-info {
  text-align: center; padding: 8px; background: #1a2d47; border-radius: 8px;
  margin-bottom: 12px; font-size: 14px; color: #8a9aaa;
}
.round-info strong { color: #d4a017; }

/* Battle area */
.battle {
  display: flex; justify-content: center; align-items: center; gap: 20px;
  min-height: 100px; margin: 16px 0;
}
.battle-card {
  width: 64px; height: 90px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; font-size: 18px; font-weight: bold;
  border: 3px solid #3a4a5a; background: #fff; color: #333;
  transition: all 0.3s; position: relative;
}
.battle-card.red { color: #c0392b; }
.battle-card.black { color: #1a1a2e; }
.battle-card.empty { background: #1a2d47; border-style: dashed; color: #3a4a5a; font-size: 13px; }
.battle-card.winner { border-color: #d4a017; box-shadow: 0 0 20px rgba(212,160,23,0.4); }
.battle-vs { font-size: 20px; color: #3a4a5a; font-weight: bold; }
.battle-label { font-size: 10px; color: #6a7a8a; text-align: center; margin-top: 4px; }

/* Cards in hand */
.hand { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin: 12px 0; }
.card {
  width: 48px; height: 66px; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; flex-direction: column; font-weight: bold; cursor: pointer;
  border: 2px solid #3a4a5a; background: #fff; color: #333;
  transition: all 0.15s; user-select: none;
}
.card:hover { transform: translateY(-6px); border-color: #6a8aaa; }
.card.selected { transform: translateY(-12px); border-color: #d4a017; box-shadow: 0 0 12px rgba(212,160,23,0.3); }
.card .rank { font-size: 16px; }
.card .suit { font-size: 12px; }
.card.red { color: #c0392b; }
.card.black { color: #1a1a2e; }

.actions { display: flex; gap: 8px; justify-content: center; margin: 12px 0; }

/* Trick result */
.trick-result {
  text-align: center; padding: 12px; border-radius: 10px; margin: 8px 0;
  font-size: 14px; animation: fadeIn 0.3s;
}
.trick-result.won { background: #0d3320; color: #2ecc71; }
.trick-result.lost { background: #2d1515; color: #e74c3c; }

/* Rules */
.rules { font-size: 12px; color: #5a6a7a; line-height: 1.6; }
.rules b { color: #8a9aaa; }

/* Log */
.log {
  max-height: 100px; overflow-y: auto; font-size: 11px; color: #4a5a6a;
  background: #0a1520; border-radius: 8px; padding: 6px 10px; margin-top: 10px;
}
.log div { padding: 2px 0; border-bottom: 1px solid #152238; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; } }
.hidden { display: none; }
