:root {
  --gold: #d4b45a;
  --gold2: #f3e0a8;
  --wine: #6b1d1d;
  --ink: #f4ead6;
  --muted: #c4b59a;
  --glass: rgba(28, 12, 8, .62);
  --line: rgba(212, 180, 90, .32);
  --danger: #e08a8a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Cormorant Garamond", Georgia, serif;
  color: var(--ink);
  background: #120805;
  overflow: hidden;
}
.sea, .sea-phone {
  position: fixed; inset: 0;
  background: url("/img/sea.jpg") center / cover no-repeat;
  transform: scale(1.08);
  animation: ken 48s ease-in-out infinite alternate;
  z-index: 0;
}
.sea-phone {
  display: none;
  background-image: url("/img/sea-phone.jpg");
}
@media (max-aspect-ratio: 3/4) {
  .sea { display: none; }
  .sea-phone { display: block; }
}
@keyframes ken {
  from { transform: scale(1.06) translate3d(0,0,0); }
  to { transform: scale(1.14) translate3d(-1%, 1%, 0); }
}
.flash, .flash-b {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  mix-blend-mode: screen;
}
.flash {
  background: radial-gradient(ellipse at 70% 18%, rgba(212,180,90,.22), transparent 48%);
  animation: glow 8s ease-in-out infinite;
}
.flash-b {
  background: radial-gradient(ellipse at 20% 80%, rgba(107,29,29,.28), transparent 42%);
  animation: glow 11s ease-in-out 2s infinite;
}
@keyframes glow {
  0%, 100% { opacity: .35; }
  50% { opacity: .7; }
}
@keyframes strobe {
  0%, 82%, 90%, 100% { opacity: 0; }
  83.5% { opacity: 1; }
  84.4% { opacity: .15; }
  85.2% { opacity: .9; }
  87% { opacity: 0; }
}
body.theme-tips .sea {
  background-image: url("/img/sport.jpg");
}
body.theme-tips .sea-phone {
  background-image: url("/img/sport-phone.jpg");
}
body.theme-tips .flash {
  background:
    radial-gradient(ellipse at 55% 8%, rgba(255,250,220,.85), transparent 38%),
    radial-gradient(ellipse at 78% 18%, rgba(212,180,90,.55), transparent 42%);
  animation: strobe 5.2s ease-in-out infinite;
  mix-blend-mode: screen;
}
body.theme-tips .flash-b {
  background: radial-gradient(ellipse at 22% 12%, rgba(255,255,255,.65), transparent 36%);
  animation: strobe 7.4s ease-in-out 1.6s infinite;
}
body.theme-football .sea { background-image: url("/img/sport.jpg"); }
body.theme-football .sea-phone { background-image: url("/img/sport-phone.jpg"); }
body.theme-football .flash,
body.theme-racing .flash {
  background:
    radial-gradient(ellipse at 55% 8%, rgba(255,250,220,.85), transparent 38%),
    radial-gradient(ellipse at 78% 18%, rgba(212,180,90,.55), transparent 42%);
  animation: strobe 5.2s ease-in-out infinite;
  mix-blend-mode: screen;
}
body.theme-football .flash-b,
body.theme-racing .flash-b {
  background: radial-gradient(ellipse at 22% 12%, rgba(255,255,255,.65), transparent 36%);
  animation: strobe 7.4s ease-in-out 1.6s infinite;
}
body.theme-racing .sea {
  background-image: url("/img/racing-live.jpg");
  animation: ken 28s ease-in-out infinite alternate;
}
body.theme-racing .sea-phone { background-image: url("/img/racing-live-phone.jpg"); }
.rain { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.vignette {
  position: fixed; inset: 0; z-index: 3; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(12,4,2,.45), transparent 22%, transparent 72%, rgba(12,4,2,.35)),
    radial-gradient(ellipse at center, transparent 42%, rgba(0,0,0,.35) 100%);
}
.screen {
  position: relative; z-index: 4;
  height: 100svh;
  max-height: 100svh;
  display: flex; flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top)) 12px 96px;
  max-width: 720px; margin: 0 auto;
}
.hidden { display: none !important; }
.word {
  font-family: Cinzel, Georgia, serif;
  font-weight: 700; letter-spacing: .22em;
  font-size: 20px;
  color: var(--gold2);
  text-shadow: 0 2px 18px rgba(212,180,90,.35);
}
.word.small { font-size: 15px; letter-spacing: .22em; }
.hint { font-size: 16px; color: var(--muted); text-align: center; }
.ghost {
  background: transparent; border: 0; color: var(--gold2); font: inherit; cursor: pointer;
}
.top {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
  flex: 0 0 auto;
}
.top-mid { flex: 1; min-width: 0; text-align: center; }
.now-engine { font-size: 14px; color: var(--gold); letter-spacing: .12em; text-transform: uppercase; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--glass); color: var(--gold2); font-size: 18px;
  backdrop-filter: blur(12px);
}
.engines {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 2px 0 10px;
  overflow: visible;
}
.eng-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.eng-row.sports {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.eng {
  width: 100%;
  min-width: 0;
  border-radius: 999px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  background: rgba(28,12,8,.55);
  color: var(--gold2);
  font-size: 14px; font-weight: 600;
  letter-spacing: .04em;
  white-space: nowrap;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(10px);
}
.eng.on {
  background: linear-gradient(90deg, rgba(107,29,29,.7), rgba(212,180,90,.28));
  box-shadow: 0 0 18px rgba(212,180,90,.28);
  color: #fff;
  border-color: var(--gold);
}
.desk {
  flex: 0 1 auto;
  max-height: 28vh;
  min-height: 0;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(28,12,8,.88);
  padding: 16px 18px 20px;
  margin-bottom: 8px;
  font-size: 19px;
  line-height: 1.6;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.desk::-webkit-scrollbar { width: 0; height: 0; display: none; }
body.panel-open .thread { display: none !important; }
body.panel-open .desk {
  flex: 1 1 auto;
  max-height: none;
}
body.news-full .composer { display: none !important; }
body.news-full .screen { padding-bottom: 12px; }
.story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 8px 0 18px;
}
@media (max-width: 640px) {
  .story-grid { grid-template-columns: 1fr; }
}
.story {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(12,6,4,.72);
  min-height: 0;
}
.story-img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #2a140c;
}
.story-img.empty {
  background: linear-gradient(135deg, #4a1c14, #1a0a08 55%, #3d2a12);
}
.story-txt {
  padding: 10px 12px 12px;
  font-size: 16px;
  line-height: 1.4;
  color: #fff6e4;
}
.story-txt small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}
.desk h3 { margin: 0 0 8px; font-family: Cinzel, Georgia, serif; color: var(--gold); font-size: 18px; letter-spacing: .1em; }
.desk .when { color: var(--muted); font-size: 15px; margin-bottom: 10px; }
.desk strong { display: block; font-size: 17px; margin: 12px 0 6px; color: var(--gold2); }
.desk li { margin: 0 0 10px; color: #fff6e4; font-size: 18px; line-height: 1.5; }
.news-link { color: #ffe08a; text-decoration: underline; font-weight: 600; }
.news-link:hover { color: #fff; }
.league-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}
.league {
  border: 1px solid var(--line);
  background: rgba(0,0,0,.25);
  color: var(--gold2);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.league.on {
  background: var(--gold);
  color: #1a0a08;
  font-weight: 700;
  border-color: var(--gold);
}
.team-lab {
  display: block;
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 15px;
}
.team-pick {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--gold);
  background: #2a140c;
  color: #fff6e4;
  font: inherit;
  font-size: 17px;
}
.score-grid { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 16px; }
.score-grid.compact .sc-row { font-size: 16px; }
.team-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 8px 0 20px;
}
@media (max-width: 700px) {
  .team-grid { grid-template-columns: 1fr; }
}
.team-batch {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px 12px;
  background: rgba(12,6,4,.7);
}
.team-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.team-name {
  font-family: Cinzel, Georgia, serif;
  color: var(--gold);
  letter-spacing: .08em;
  font-size: 16px;
}
.mini {
  display: grid;
  grid-template-columns: 22px 26px 1fr auto auto;
  gap: 8px;
  align-items: center;
  font-size: 15px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(212,180,90,.12);
}
.mini-ha { color: var(--gold); font-size: 12px; text-align: center; }
.mini-opp { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-sc { font-family: Cinzel, Georgia, serif; color: var(--gold2); white-space: nowrap; }
.mini-dt { color: var(--muted); font-size: 12px; white-space: nowrap; }
.score-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(12,6,4,.55);
}
.sc-date { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.sc-row {
  display: grid;
  grid-template-columns: 28px minmax(0,1fr) auto minmax(0,1fr) 28px;
  align-items: center;
  gap: 8px;
  font-size: 17px;
}
.sc-team { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-team.right { text-align: right; }
.sc-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: Cinzel, Georgia, serif;
  font-size: 22px;
  color: var(--gold);
  white-space: nowrap;
}
.sc-score i { font-style: normal; color: var(--muted); font-size: 16px; }
.sc-badge {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 50%;
  background: #1a0a08;
  flex: 0 0 28px;
}
.sc-badge.empty { background: linear-gradient(135deg, #4a1c14, #1a0a08); }
.sc-soon { color: var(--gold2); letter-spacing: .12em; font-size: 14px; white-space: nowrap; }
.desk ul { margin: 0 0 12px; padding-left: 22px; }
.tipblock { white-space: pre-wrap; margin: 6px 0 12px; line-height: 1.55; font-size: 18px; }
.slip {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 10px 0;
  background: rgba(12,6,4,.78);
}
.stakes {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px;
}
.stake {
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold2);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}
.stake.on {
  background: var(--gold);
  color: #1a0a08;
  font-weight: 700;
}
.slip-head {
  font-family: Cinzel, Georgia, serif;
  letter-spacing: .16em;
  font-size: 11px;
  color: var(--gold);
  margin-bottom: 4px;
}
.slip-event { font-weight: 700; font-size: 18px; margin-bottom: 4px; color: var(--gold2); }
.slip-row { display: flex; justify-content: space-between; gap: 8px; font-size: 16px; color: var(--muted); }
.slip-why { font-size: 16px; margin-top: 6px; line-height: 1.45; }
.bet365-btn {
  margin-top: 8px;
  text-align: center;
  background: var(--gold);
  color: #1a0a08;
  font-weight: 800;
  font-family: Cinzel, Georgia, serif;
  letter-spacing: .06em;
  padding: 9px;
  border-radius: 10px;
}
.thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 2px 24px;
  display: flex; flex-direction: column; gap: 12px;
  scrollbar-width: none;
}
.thread::-webkit-scrollbar { width: 0; height: 0; }
.bubble {
  max-width: 100%;
  padding: 14px 16px;
  border-radius: 16px 16px 16px 4px;
  background: rgba(28,12,8,.88);
  border: 1px solid var(--line);
  line-height: 1.6;
  font-size: 18px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.bubble-body { display: block; }
.bubble-body p { margin: 0 0 10px; }
.bubble-body .li { margin: 0 0 8px; padding-left: 4px; }
.bubble-body pre { white-space: pre-wrap; overflow-x: auto; }
.bubble.me {
  align-self: flex-end;
  border-radius: 16px 16px 4px 16px;
  background: linear-gradient(180deg, rgba(107,29,29,.55), rgba(28,12,8,.7));
}
.bubble .meta { font-size: 14px; color: var(--muted); margin-bottom: 4px; letter-spacing: .08em; }
.welcome {
  text-align: center; color: var(--gold2);
  padding: 28px 10px; text-shadow: 0 2px 18px rgba(0,0,0,.6);
}
.welcome h2 {
  font-family: Cinzel, Georgia, serif; letter-spacing: .28em; font-size: 22px; margin: 0 0 8px;
  color: var(--gold);
}
.typing { opacity: .85; font-style: italic; }
.composer {
  display: flex; gap: 8px; align-items: center;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: min(720px, calc(100% - 24px));
  z-index: 40;
  min-height: 72px;
  margin: 0;
  background: #4a2418;
  border: 3px solid #f3e0a8;
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.55), 0 0 28px rgba(212,180,90,.45);
}
.composer textarea {
  flex: 1; resize: none; min-height: 52px; max-height: 120px;
  background: #2a140c; border: 0; color: #fffef6;
  caret-color: #f3e0a8;
  font: inherit; font-size: 20px; outline: none;
  border-radius: 10px; padding: 12px;
}
.composer textarea::placeholder {
  color: #e8d5a3;
  opacity: 1;
}
.send {
  flex: 0 0 auto;
  min-width: 84px; height: 52px; border-radius: 12px; border: 0;
  background: #f3e0a8;
  color: #1a0a08; font-size: 18px; font-weight: 800;
  box-shadow: 0 0 18px rgba(212,180,90,.45);
  font-family: Cinzel, Georgia, serif;
}
.drawer {
  position: fixed; z-index: 8; top: 0; bottom: 0; left: 0;
  width: min(360px, 88vw);
  background: rgba(18,6,4,.9);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(22px);
  padding: calc(18px + env(safe-area-inset-top)) 16px 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.chat-list { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.chat-row {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; color: var(--ink); text-align: left;
  font: inherit; width: 100%;
}
.shade {
  position: fixed; inset: 0; z-index: 7; background: rgba(0,0,0,.5);
}
code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; color: var(--gold); }
