* { box-sizing: border-box; }

@keyframes popIn {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes rowIn {
  from { transform: translateX(-6px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes confettiFall {
  0%   { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0.85; }
}

@keyframes bannerPop {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 56px 16px;
  background: #ece5d8;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #201c15;
  position: relative;
  overflow-x: hidden;
}

.glow {
  position: fixed;
  top: 4%;
  left: 50%;
  width: 520px;
  height: 420px;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 30% 30%, rgba(242, 166, 90, 0.55), transparent 60%),
    radial-gradient(circle at 65% 40%, rgba(217, 124, 160, 0.5), transparent 60%),
    radial-gradient(circle at 50% 65%, rgba(143, 111, 168, 0.45), transparent 60%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
}

.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  background: #f8f4ea;
  border: 1px solid rgba(32, 28, 21, 0.08);
  border-radius: 22px;
  padding: 40px 36px 30px;
  box-shadow: 0 24px 48px rgba(32, 28, 21, 0.14);
  animation: popIn 0.35s ease-out;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 2.1rem;
  letter-spacing: -0.5px;
  text-align: center;
  color: #201c15;
}

.caption {
  display: block;
  margin: 6px 0 28px;
  text-align: center;
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 1.4px;
  color: #9a9182;
}

#guess-form {
  margin-bottom: 20px;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #9a9182;
}

#guess-input {
  display: block;
  width: 100%;
  padding: 13px 14px;
  margin-bottom: 12px;
  font-size: 1rem;
  border: 1px solid #d9d2c1;
  border-radius: 10px;
  background: #fff;
  color: #201c15;
  transition: border-color 0.15s;
}

#guess-input::placeholder {
  color: #b7ae9c;
}

#guess-input:focus {
  outline: none;
  border-color: #201c15;
}

button {
  display: block;
  width: 100%;
  padding: 14px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  border: none;
  border-radius: 999px;
  background: #201c15;
  color: #f8f4ea;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s;
}

button:hover {
  background: #3a3428;
}

button:active {
  transform: scale(0.98);
}

#status {
  display: flex;
  justify-content: space-between;
  color: #9a9182;
  margin-bottom: 18px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

#win-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: #f0ead9;
  border: 1px solid rgba(32, 28, 21, 0.08);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 18px;
  animation: bannerPop 0.3s ease-out;
}

.win-title {
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 1.6rem;
  color: #201c15;
}

.win-sub {
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: #9a9182;
}

.hidden,
#win-banner.hidden {
  display: none;
}

#guess-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

#guess-table th {
  text-align: left;
  padding: 8px 6px;
  color: #9a9182;
  border-bottom: 1px solid #e2dccb;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.66rem;
  letter-spacing: 0.8px;
}

#guess-table td {
  padding: 11px 6px;
  border-bottom: 1px solid #eee7d8;
  color: #201c15;
}

#guess-table tbody tr {
  animation: rowIn 0.2s ease-out;
  transition: background 0.15s;
}

#guess-table tbody tr:hover {
  background: rgba(32, 28, 21, 0.03);
}

.latest {
  background: rgba(32, 28, 21, 0.04);
  box-shadow: inset 2px 0 0 #201c15;
}

.score-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 100px;
}

.score-num {
  font-weight: 700;
  min-width: 24px;
  text-align: right;
}

.score-bar-track {
  flex: 1;
  height: 5px;
  background: #e2dccb;
  border-radius: 3px;
  overflow: hidden;
}

.score-bar-fill {
  display: block;
  height: 100%;
  transition: width 0.3s ease-out;
}

.temp-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: 1px solid rgba(32, 28, 21, 0.15);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #201c15;
  white-space: nowrap;
}

.confetti {
  position: fixed;
  top: 0;
  font-size: 1.4rem;
  pointer-events: none;
  z-index: 10;
  animation: confettiFall linear forwards;
}
