@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Inter:wght@400;500&display=swap");

/* ===== Base Reset ===== */
* {
  box-sizing: border-box;
}

:root {
  --bg1: #0f3d2e;
  --bg2: #06130f;
  --glass: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.72);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --gold1: #f7d774;
  --gold2: #d4af37;
}

/* ===== Page ===== */
body {
  margin: 0;
  padding: 24px;
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, var(--bg1), var(--bg2));
  text-align: center;
}

/* ===== Brand Header ===== */
.brand-header {
  width: min(980px, 100%);
  margin-bottom: 16px;
  position: relative;
}

.brand-title {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  letter-spacing: 1px;
  background: linear-gradient(135deg, var(--gold1), var(--gold2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}



/* Decorative gold underline */
.brand-title::after {
  content: "";
  display: block;
  width: 120px;
  height: 3px;
  margin: 12px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold2), transparent);
  border-radius: 4px;
}

/* Subtitle */
.subtitle {
  margin: 10px 0 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

/* ===== Game Container ===== */
#game {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 18px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* ===== HUD ===== */
#hud {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 16px;
}

.hud-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

input {
  width: 92px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
}

/* ===== Hands ===== */
#dealer,
.player {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.16);
  margin-bottom: 14px;
  text-align: left;
}

h2 {
  margin: 0 0 10px 0;
  font-size: 1.15rem;
}

#dealer-score,
#player-score {
  margin: 10px 0 0 0;
  color: var(--muted);
}

/* Cards row */
.cards {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 130px;
  align-items: center;
}

/* ===== Cards ===== */
.card {
  width: 84px;
  height: 120px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card.back {
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.85);
}

/* ===== Controls ===== */
#controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
  justify-content: center;
}

button {
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}

button:hover {
  background: rgba(255, 255, 255, 0.18);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ===== Message ===== */
#message {
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.18);
  min-height: 44px;
}

/* ===== Deal Animation ===== */
@keyframes dealIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card.deal {
  animation: dealIn 220ms ease-out both;
}
