/* public/css/style.css */

html { font-feature-settings: 'tnum' 1; }

body {
  background-image: radial-gradient(circle at 1px 1px, rgba(237, 230, 214, 0.035) 1px, transparent 0);
  background-size: 22px 22px;
}

.glow {
  position: absolute;
  top: -10%;
  left: 50%;
  width: 600px;
  height: 600px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(201, 162, 39, 0.14), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.field {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid #2A282E;
  color: #EDE6D6;
  font-family: 'Work Sans', sans-serif;
  font-size: 0.95rem;
  padding: 0.5rem 0.1rem;
  outline: none;
  transition: border-color 0.2s ease;
}
.field::placeholder { color: #5c5954; }
.field:focus { border-bottom-color: #C9A227; }

select.field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238C8780' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.2rem center;
  padding-right: 1.5rem;
}

.btn-primary {
  background: linear-gradient(180deg, #d4af37, #b8862c);
  color: #0B0B0D;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 2px;
  padding: 0.65rem 1rem;
  border: 1px solid rgba(0,0,0,0.15);
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible { outline: 2px solid #EDE6D6; outline-offset: 2px; }

.btn-ghost {
  background: transparent;
  border: 1px solid #2A282E;
  color: #EDE6D6;
  font-family: 'Work Sans', sans-serif;
  font-size: 0.85rem;
  border-radius: 2px;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.btn-ghost:hover { border-color: #C9A227; color: #C9A227; }
.btn-ghost:focus-visible { outline: 2px solid #C9A227; outline-offset: 2px; }

.btn-danger {
  background: transparent;
  border: 1px solid #5c1a1a;
  color: #e57373;
  font-family: 'Work Sans', sans-serif;
  font-size: 0.8rem;
  border-radius: 2px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.btn-danger:hover { border-color: #e57373; color: #ffcdd2; }

.tab-btn { background: transparent; cursor: pointer; }
.tab-btn:focus-visible { outline: 2px solid #C9A227; outline-offset: 3px; }

.seal-enter { animation: seal-in 0.6s ease-out both; }
@keyframes seal-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Juomatiili */
.drink-tile {
  position: relative;
  background: #16151A;
  border: 1px solid #2A282E;
  border-radius: 2px;
  padding: 0.85rem 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.08s ease;
  overflow: hidden;
}
.drink-tile:hover { border-color: #B8743A; }
.drink-tile:active { transform: scale(0.98); }
.drink-tile:focus-visible { outline: 2px solid #C9A227; outline-offset: 2px; }
.drink-tile.pulsing { animation: tile-pulse 0.45s ease-out; }
@keyframes tile-pulse {
  0% { box-shadow: 0 0 0 0 rgba(201,162,39,0.55); }
  100% { box-shadow: 0 0 0 14px rgba(201,162,39,0); }
}

.tile-flash {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11,11,13,0.88);
  color: #C9A227;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.1rem;
  opacity: 0;
  pointer-events: none;
}
.tile-flash.show { animation: flash-pop 0.5s ease-out; }
@keyframes flash-pop {
  0% { opacity: 0; transform: scale(0.85); }
  25% { opacity: 1; transform: scale(1.05); }
  70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}

/* Juomakuva */
.drink-image {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 2px;
  margin-bottom: 0.5rem;
  background: #0B0B0D;
}

/* Suosikki-nappi */
.fav-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.6;
  transition: opacity 0.15s ease, transform 0.1s ease;
  z-index: 2;
}
.fav-btn:hover { opacity: 1; transform: scale(1.15); }
.fav-btn.active { opacity: 1; }

/* Arvostelunappi */
.review-btn {
  background: transparent;
  border: none;
  color: #8C8780;
  cursor: pointer;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  transition: color 0.15s ease;
}
.review-btn:hover { color: #C9A227; }

/* Tähdet */
.star-btn { background: transparent; border: none; cursor: pointer; transition: color 0.15s ease; }
.star-btn.active { color: #C9A227; }
.star-btn:not(.active) { color: #2A282E; }

/* Stat-number */
.stat-number {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 3.4rem);
  line-height: 1;
  color: #EDE6D6;
}
.stat-number.bump { animation: bump 0.3s ease-out; }
@keyframes bump {
  0% { color: #C9A227; }
  100% { color: #EDE6D6; }
}

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #8C8780;
}

.rank-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  width: 1.9rem;
  text-align: right;
  flex-shrink: 0;
}

/* Admin-taulukko */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  text-align: left;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #8C8780;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #2A282E;
}
.admin-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #2A282E;
  font-size: 0.9rem;
}
.admin-table tr:last-child td { border-bottom: none; }

.admin-panel {
  background: #16151A;
  border: 1px solid #2A282E;
  border-radius: 2px;
  padding: 1.25rem;
}

/* Saavutukset */
.achievement-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #16151A;
  border: 1px solid #2A282E;
  border-radius: 2px;
  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;
}
.achievement-badge .icon { font-size: 1.1rem; }

/* Modaalit */
.modal-bg { background: rgba(11, 11, 13, 0.88); }

/* Bottom nav */
nav.fixed { backdrop-filter: blur(8px); }

@media (prefers-reduced-motion: reduce) {
  .seal-enter, .drink-tile.pulsing, .tile-flash.show, .stat-number.bump { animation: none !important; }
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #0B0B0D; }
::-webkit-scrollbar-thumb { background: #2A282E; border-radius: 4px; }
