/* ==========================================================================
   Fishin' Game — client styles
   Every screen is one full-bleed image with UI layered on top.
   ========================================================================== */

:root {
  --gold:        #e8cf92;
  --gold-bright: #ffe6ad;
  --gold-dim:    #8a7648;
  --ink:         #0a0d12;
  --panel:       rgba(10, 12, 16, 0.86);
  --panel-edge:  rgba(232, 207, 146, 0.35);
  --text:        #ded7c6;
  --text-dim:    #9c9483;
  --danger:      #e0776a;
  --success:     #8fc9a0;
  --rail-w:      min(300px, 22vw);
  --ease:        cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--text);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

#app { position: relative; height: 100%; }

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  opacity: 0;
  transition: opacity 420ms var(--ease);
}
.screen[hidden] { display: none; }
.screen.is-visible { opacity: 1; }

/* --------------------------------------------------------------- backdrop */

.screen--auth,
.screen--loading {
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 35%, rgba(20, 34, 52, 0.25), transparent 60%),
    linear-gradient(180deg, rgba(6, 9, 14, 0.72), rgba(6, 9, 14, 0.9)),
    var(--bg-image, linear-gradient(160deg, #16202e, #080b11)) center / cover no-repeat;
}

/* ------------------------------------------------------------- auth cards */

.auth-card {
  width: min(420px, calc(100vw - 40px));
  padding: 36px 34px 30px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(6px);
  animation: rise 480ms var(--ease) both;
}
.auth-card--narrow { text-align: center; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.brand {
  margin: 0 0 6px;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--gold);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}
.brand-sub {
  margin: 0 0 26px;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
}

.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-dim);
}
.field input {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(232, 207, 146, 0.22);
  border-radius: 7px;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease);
}
.field input:hover { border-color: rgba(232, 207, 146, 0.4); }
.field input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232, 207, 146, 0.14);
}
.field.has-error input { border-color: var(--danger); }

.field-error {
  display: none;
  margin-top: 5px;
  font-size: 12.5px;
  font-style: normal;
  color: var(--danger);
}
.field.has-error .field-error { display: block; }

.form-message {
  min-height: 20px;
  margin: 4px 0 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-dim);
}
.form-message.is-error   { color: var(--danger); }
.form-message.is-success { color: var(--success); }

.btn {
  display: block;
  width: 100%;
  padding: 12px 18px;
  font: inherit;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 7px;
  border: 1px solid var(--gold-dim);
  background: linear-gradient(180deg, rgba(232, 207, 146, 0.16), rgba(232, 207, 146, 0.06));
  color: var(--gold-bright);
  transition: transform 120ms var(--ease), background 160ms var(--ease), box-shadow 160ms var(--ease);
}
.btn:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(232, 207, 146, 0.3), rgba(232, 207, 146, 0.12));
  box-shadow: 0 0 20px rgba(232, 207, 146, 0.2);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: progress; }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
  font-size: 13px;
}
.auth-links a {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 140ms var(--ease), border-color 140ms var(--ease);
}
.auth-links a:hover { color: var(--gold); border-bottom-color: var(--gold-dim); }

/* ---------------------------------------------------------------- loading */

.loader { width: min(440px, calc(100vw - 40px)); text-align: center; }
.progress {
  height: 6px;
  margin: 22px 0 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(232, 207, 146, 0.25);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
  box-shadow: 0 0 14px rgba(232, 207, 146, 0.5);
  transition: width 260ms var(--ease);
}
.progress-label { margin: 0; font-size: 13px; color: var(--text-dim); letter-spacing: 0.04em; }

/* -------------------------------------------------------------- main menu */

.screen--menu { align-items: stretch; }

.menu-scene {
  position: absolute;
  inset: 0;
  background: var(--bg-image, #0d141d) center / cover no-repeat;
  animation: driftIn 1200ms var(--ease) both;
}
@keyframes driftIn {
  from { opacity: 0; transform: scale(1.04); }
  to   { opacity: 1; transform: none; }
}

.menu-rail {
  position: relative;
  z-index: 2;
  width: var(--rail-w);
  height: 100%;
  padding: clamp(12px, 3vh, 34px) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  background: linear-gradient(180deg, rgba(8, 10, 14, 0.94), rgba(12, 14, 18, 0.9));
  border-right: 1px solid rgba(232, 207, 146, 0.4);
  box-shadow: 6px 0 40px rgba(0, 0, 0, 0.65);
  animation: slideIn 620ms var(--ease) both;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: none; }
}

/* corner filigree, drawn in CSS so there is no extra asset to load */
.menu-rail::before,
.menu-rail::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 26px;
  border: 1px solid rgba(232, 207, 146, 0.28);
  pointer-events: none;
}
.menu-rail::before { top: 8px;    border-bottom: none; border-radius: 6px 6px 0 0; }
.menu-rail::after  { bottom: 8px; border-top: none;    border-radius: 0 0 6px 6px; }

.rail-flourish {
  width: 22px; height: 22px;
  border: 1px solid rgba(232, 207, 146, 0.5);
  transform: rotate(45deg);
  opacity: 0.55;
}
.rail-flourish--top    { margin-top: 2px; }
.rail-flourish--bottom { margin-bottom: 2px; }

.rail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  background: none;
  border: 0;
  color: var(--gold);
  font: inherit;
  cursor: pointer;
  transition: transform 200ms var(--ease), color 200ms var(--ease);
}
.rail-item:focus { outline: none; }
.rail-item:focus-visible .rail-icon {
  outline: 2px solid var(--gold-bright);
  outline-offset: 4px;
}

.rail-icon {
  display: grid;
  place-items: center;
  width: clamp(56px, 6.2vw, 92px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid rgba(232, 207, 146, 0.55);
  background: radial-gradient(circle at 50% 30%, rgba(232, 207, 146, 0.08), rgba(0, 0, 0, 0.55));
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.7);
  transition: border-color 220ms var(--ease), box-shadow 220ms var(--ease), background 220ms var(--ease);
}
.rail-icon svg {
  width: 52%;
  height: 52%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: filter 220ms var(--ease);
}
/* the cog is drawn on a tighter 24-unit grid than the rest */
.rail-icon svg[viewBox="0 0 24 24"] { width: 46%; height: 46%; stroke-width: 1.6; }

.rail-label {
  font-size: clamp(11px, 1vw, 15px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(232, 207, 146, 0.82);
  transition: color 200ms var(--ease), text-shadow 200ms var(--ease);
}

/* --- hover / focus highlight --- */
.rail-item:hover,
.rail-item:focus-visible { transform: translateX(4px); color: var(--gold-bright); }

.rail-item:hover .rail-icon,
.rail-item:focus-visible .rail-icon {
  border-color: var(--gold-bright);
  background: radial-gradient(circle at 50% 30%, rgba(232, 207, 146, 0.22), rgba(0, 0, 0, 0.5));
  box-shadow:
    0 0 22px rgba(232, 207, 146, 0.45),
    inset 0 0 24px rgba(232, 207, 146, 0.18);
}
.rail-item:hover .rail-icon svg,
.rail-item:focus-visible .rail-icon svg {
  filter: drop-shadow(0 0 6px rgba(255, 230, 173, 0.8));
}
.rail-item:hover .rail-label,
.rail-item:focus-visible .rail-label {
  color: var(--gold-bright);
  text-shadow: 0 0 12px rgba(232, 207, 146, 0.6);
}
.rail-item:active { transform: translateX(4px) scale(0.97); }

.rail-item--logout:hover .rail-icon,
.rail-item--logout:focus-visible .rail-icon {
  border-color: #f0a08f;
  box-shadow: 0 0 22px rgba(224, 119, 106, 0.45), inset 0 0 24px rgba(224, 119, 106, 0.18);
}
.rail-item--logout:hover,
.rail-item--logout:focus-visible { color: #f4b1a2; }
.rail-item--logout:hover .rail-label { color: #f4b1a2; text-shadow: 0 0 12px rgba(224, 119, 106, 0.5); }

/* ---------------------------------------------------------------- hud */

.hud {
  position: absolute;
  z-index: 3;
  top: 18px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 16px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--text);
  background: rgba(8, 10, 14, 0.72);
  border: 1px solid rgba(232, 207, 146, 0.3);
  border-radius: 99px;
  backdrop-filter: blur(4px);
}
.hud-name { color: var(--gold); font-size: 14px; }
.hud-stat b { color: var(--gold-bright); font-weight: 600; }
.hud-badge {
  padding: 2px 9px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--gold);
  border-radius: 99px;
}

/* ---------------------------------------------------------------- toast */

.toast {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 12px);
  padding: 11px 20px;
  font-size: 14px;
  color: var(--text);
  background: rgba(8, 10, 14, 0.9);
  border: 1px solid var(--panel-edge);
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- mobile */

@media (max-width: 720px) {
  .menu-rail {
    width: 100%;
    height: auto;
    flex-direction: row;
    justify-content: space-around;
    padding: 10px 4px;
    align-self: flex-end;
    border-right: 0;
    border-top: 1px solid rgba(232, 207, 146, 0.4);
  }
  .menu-rail::before, .menu-rail::after, .rail-flourish { display: none; }
  .screen--menu { align-items: flex-end; }
  .rail-icon { width: 46px; }
  .rail-label { font-size: 10px; letter-spacing: 0.1em; }
  .hud { top: 12px; right: 12px; left: 12px; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
