/* ============================================================
   style.css — I LOVE POKER 2.0  Game Lobby Theme
   Splatoon-inspired dark × neon × ink-splatter aesthetic
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Noto+Sans+JP:wght@400;500;700;900&display=swap');

:root {
  --bg: #F5F5F8;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F0F0F5;
  --bg-secondary: #FFFFFF;
  --bg-modal: rgba(0,0,0,0.5);
  --text: #1A1A2E;
  --text-sub: #555566;
  --text-caption: #8E8EA0;
  --border: #E0E0E8;
  --accent: #FF2D78;
  --green: #00C853;
  --purple: #7C4DFF;
  --orange: #FF6D00;
  --pink: #FF2D78;
  --blue: #448AFF;
  --yellow: #F5A623;
  --success: #00C853;
  --error: #FF3D00;
  --warning: #F5A623;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 36px;
  --font-en: 'Fredoka', sans-serif;
  --font-ja: 'Noto Sans JP', sans-serif;
  --transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-ja);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt";
  position: relative;
}

/* === PAINT SPLATTER TEXT (white w/ black outline) === */
.paint-text {
  color: #FFFFFF;
  -webkit-text-stroke: 2.5px #1A1A2E;
  paint-order: stroke fill;
  text-shadow: 2px 2px 0 #1A1A2E, -1px -1px 0 #1A1A2E, 1px -1px 0 #1A1A2E, -1px 1px 0 #1A1A2E;
}
.paint-text .heart {
  -webkit-text-stroke: 2px #1A1A2E;
}

/* === FLOATING MASCOTS === */
.floating-mascots {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  max-width: 520px;
  margin: 0 auto;
}
.float-mascot {
  position: absolute;
  opacity: 0.06;
  animation: floatDrift 20s ease-in-out infinite;
}
.float-mascot:nth-child(1) { width: 80px; top: 12%; left: -10px; animation-delay: 0s; animation-duration: 22s; }
.float-mascot:nth-child(2) { width: 60px; top: 35%; right: -5px; animation-delay: -5s; animation-duration: 18s; }
.float-mascot:nth-child(3) { width: 70px; top: 55%; left: 5%; animation-delay: -10s; animation-duration: 25s; }
.float-mascot:nth-child(4) { width: 55px; top: 75%; right: 8%; animation-delay: -3s; animation-duration: 20s; }
.float-mascot:nth-child(5) { width: 65px; top: 20%; right: 15%; animation-delay: -8s; animation-duration: 24s; }
.float-mascot:nth-child(6) { width: 50px; top: 90%; left: 20%; animation-delay: -12s; animation-duration: 19s; }
.float-mascot:nth-child(7) { width: 45px; top: 45%; left: 75%; animation-delay: -7s; animation-duration: 21s; }
.float-mascot:nth-child(8) { width: 75px; top: 65%; right: 30%; animation-delay: -15s; animation-duration: 23s; }

@keyframes floatDrift {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-15px) rotate(5deg); }
  50% { transform: translateY(8px) rotate(-3deg); }
  75% { transform: translateY(-10px) rotate(4deg); }
}

/* === PAINT SPLATTER DECORATIONS === */
.paint-splat {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
  z-index: 0;
}

/* Page-level paint splatters — now handled by splatters.js SVGs */
.page { position: relative; overflow: hidden; }
.bg-splatters { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; max-width: 520px; margin: 0 auto; left: 0; right: 0; }
.en { font-family: var(--font-en), var(--font-ja); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }

/* === SPLASH SCREEN === */
#splash {
  position: fixed; inset: 0; z-index: 9999;
  background: #1A1A2E;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity 0.6s, visibility 0.6s;
}
#splash.fade-out { opacity: 0; visibility: hidden; }
.splash-mascots {
  display: flex; gap: 16px; margin-bottom: 32px;
}
.splash-mascot {
  width: 56px; height: 56px;
  border-radius: 50%;
  animation: mascotPop 1.6s ease infinite;
}
.splash-mascot:nth-child(1) { animation-delay: 0s; }
.splash-mascot:nth-child(2) { animation-delay: 0.2s; }
.splash-mascot:nth-child(3) { animation-delay: 0.4s; }
.splash-mascot:nth-child(4) { animation-delay: 0.6s; }
.splash-mascot img { width: 100%; height: 100%; object-fit: contain; }

@keyframes mascotPop {
  0%, 100% { transform: scale(1) translateY(0); filter: brightness(0.85); }
  25% { transform: scale(1.25) translateY(-12px); filter: brightness(1.1) drop-shadow(0 0 16px currentColor); }
  50% { transform: scale(1) translateY(0); filter: brightness(0.85); }
}
.splash-title {
  font-family: var(--font-en);
  font-size: 1.6rem; font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 24px;
  color: #FFFFFF;
  -webkit-text-stroke: 2.5px #1A1A2E;
  paint-order: stroke fill;
  text-shadow: 2px 2px 0 #1A1A2E, -1px -1px 0 #1A1A2E, 1px -1px 0 #1A1A2E, -1px 1px 0 #1A1A2E;
}
.splash-bar-wrap {
  width: 120px; height: 6px;
  background: #2A2A45; border-radius: 3px;
  overflow: hidden;
}
.splash-bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--green), var(--pink), var(--orange), var(--purple));
  border-radius: 3px;
  transition: width 0.4s ease;
}
.splash-sub { margin-top: 12px; font-size: 0.75rem; color: #6B6B85; }

/* === FAILSAFE === */
.splash-failsafe {
  display: none; margin-top: 24px;
}
.splash-failsafe.show { display: block; }
.splash-failsafe button {
  padding: 12px 24px;
  background: var(--accent);
  color: white; font-weight: 700;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

/* === APP HEADER === */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 6px 16px;
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  height: 52px;
}
.header-mascot {
  width: 28px; height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}
.header-logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}
.header-title {
  font-family: var(--font-en);
  font-size: 1.15rem; font-weight: 700;
  letter-spacing: 0.03em;
  color: #FFFFFF;
  -webkit-text-stroke: 2px #1A1A2E;
  paint-order: stroke fill;
  text-shadow: 2px 2px 0 #1A1A2E, -1px -1px 0 #1A1A2E, 1px -1px 0 #1A1A2E, -1px 1px 0 #1A1A2E;
}
.header-heart { color: var(--pink); -webkit-text-stroke: 1.5px #1A1A2E; }

/* === TAB BAR === */
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-around;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.tab-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  padding: 4px 8px;
  color: var(--text-caption);
  transition: var(--transition);
  position: relative;
  flex: 1;
}
.tab-item.active { color: var(--green); }
.tab-item.active::after {
  content: '';
  position: absolute; top: -6px;
  width: 24px; height: 3px;
  background: var(--green);
  border-radius: 2px;
}
.tab-icon { width: 24px; height: 24px; }
.tab-label { font-size: 0.6rem; font-weight: 600; }

/* === CONTAINER === */
.page { padding-bottom: calc(80px + env(safe-area-inset-bottom)); min-height: 100vh; }
.container { padding: 0 16px; max-width: 520px; margin: 0 auto; }

/* === HERO === */
.hero {
  position: relative;
  width: 100%; height: 220px;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: brightness(0.85) saturate(1.3);
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(245,245,248,0) 20%, var(--bg) 100%);
}
.hero-content {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 24px;
  text-align: center;
}
.hero-logo {
  font-family: var(--font-en); font-size: 2rem; font-weight: 700;
  color: #FFFFFF;
  -webkit-text-stroke: 2.5px #1A1A2E;
  paint-order: stroke fill;
  text-shadow: 3px 3px 0 #1A1A2E, -1px -1px 0 #1A1A2E, 1px -1px 0 #1A1A2E, -1px 1px 0 #1A1A2E, 0 4px 12px rgba(0,0,0,0.15);
}
.hero-logo .heart { color: var(--pink); -webkit-text-stroke: 2px #1A1A2E; font-size: 1.8rem; }
.hero-dates {
  font-family: var(--font-en); font-size: 0.9rem;
  color: var(--text-sub); letter-spacing: 0.15em;
  margin-top: 4px;
}
.hero-tagline { font-size: 0.75rem; color: var(--text-caption); margin-top: 6px; }

/* === DAY TABS === */
.day-tabs {
  display: flex; gap: 6px;
  padding: 16px 0 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.day-tabs::-webkit-scrollbar { display: none; }
.day-tab {
  flex: 1; min-width: 0;
  padding: 10px 6px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 2px solid transparent;
  text-align: center;
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.day-tab::before {
  content: '';
  position: absolute; inset: -2px;
  opacity: 0; transition: opacity 0.3s;
  border-radius: inherit;
  background: currentColor;
}
.day-tab.active { border-color: currentColor; color: currentColor; }
.day-tab.active::before { opacity: 0.12; }
.day-tab.active .day-tab-date { color: inherit; }
.day-tab.active .day-tab-day { color: inherit; opacity: 0.7; }
.day-tab.active .day-tab-label { color: inherit; }
.day-tab-date { font-family: var(--font-en); font-size: 0.85rem; font-weight: 700; }
.day-tab-day { font-family: var(--font-en); font-size: 0.65rem; color: var(--text-caption); margin-top: 2px; }
.day-tab-label { font-family: var(--font-en); font-size: 0.6rem; font-weight: 600; margin-top: 2px; }

/* === TOURNAMENT CARD === */
.tournament-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: transform 0.2s var(--bounce), box-shadow 0.3s;
  position: relative; overflow: hidden;
  animation: cardIn 0.4s var(--bounce) backwards;
}
.tournament-card:active { transform: scale(0.97); }
.tournament-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Card stagger */
.tournament-card:nth-child(1) { animation-delay: 0.05s; }
.tournament-card:nth-child(2) { animation-delay: 0.1s; }
.tournament-card:nth-child(3) { animation-delay: 0.15s; }
.tournament-card:nth-child(4) { animation-delay: 0.2s; }
.tournament-card:nth-child(5) { animation-delay: 0.25s; }
.tournament-card:nth-child(6) { animation-delay: 0.3s; }
.tournament-card:nth-child(7) { animation-delay: 0.35s; }
.tournament-card:nth-child(8) { animation-delay: 0.4s; }
.tournament-card:nth-child(9) { animation-delay: 0.45s; }
.tournament-card:nth-child(10) { animation-delay: 0.5s; }
.tournament-card:nth-child(11) { animation-delay: 0.55s; }
.tournament-card:nth-child(12) { animation-delay: 0.6s; }
.tournament-card:nth-child(13) { animation-delay: 0.65s; }

.card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.card-num {
  font-family: var(--font-en);
  font-size: 0.7rem; font-weight: 700;
  padding: 3px 8px;
  background: rgba(0,0,0,0.05);
  border-radius: 6px;
  color: var(--text-sub);
}
.card-badges { display: flex; gap: 6px; align-items: center; }
.card-badge {
  font-family: var(--font-en);
  font-size: 0.65rem; font-weight: 600;
  padding: 3px 8px; border-radius: 6px;
}
.badge-upcoming { background: rgba(0,0,0,0.04); color: var(--text-caption); font-size: 0.65rem; }
.badge-ticket { background: rgba(245,166,35,0.12); color: #C07800; }
.badge-yt { background: rgba(255,0,0,0.1); color: #CC0000; }
.badge-open {
  background: var(--green); color: #FFF;
  animation: badgePulse 2s ease infinite;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,200,83,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(0,200,83,0); }
}
.badge-closed { background: rgba(0,0,0,0.06); color: var(--text-caption); font-size: 0.65rem; }
.badge-finished { background: rgba(245,166,35,0.12); color: #C07800; }

.card-name {
  font-family: var(--font-en);
  font-size: 1.1rem; font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
}
.card-info { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 0.8rem; }
.card-info-item { display: flex; align-items: center; gap: 4px; color: var(--text-sub); }
.card-info-label { font-size: 0.65rem; color: var(--text-caption); }
.card-info-value { font-family: var(--font-en); font-weight: 600; }
.card-time-changed { text-decoration: line-through; color: var(--text-caption); font-size: 0.75rem; }
.card-time-new { color: var(--error); font-weight: 700; }

.card-entry {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-entry-fee { font-family: var(--font-en); font-weight: 700; font-size: 1rem; }
.card-chips { font-size: 0.75rem; color: var(--text-caption); }
.card-chips span { font-family: var(--font-en); font-weight: 600; color: var(--text-sub); }
.card-prize { font-family: var(--font-en); font-size: 0.8rem; color: #C07800; font-weight: 600; }

.card-trophy-icon {
  position: absolute; top: 12px; right: 16px;
  font-size: 1.4rem; opacity: 0.3;
}

/* Card states */
.tournament-card.state-open {
  border-color: var(--green);
  box-shadow: 0 2px 12px rgba(0,200,83,0.15);
}
.tournament-card.state-open .card-name { color: var(--green); }

.tournament-card.state-closed {
  filter: grayscale(0.5);
  opacity: 0.65;
  border-color: var(--border);
}

.tournament-card.state-finished { border-color: var(--border); }
.card-winner-row {
  display: none;
  align-items: center; gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(245,166,35,0.08), rgba(255,45,120,0.04));
  border-radius: var(--radius-md);
}
.state-finished .card-winner-row { display: flex; }
.winner-photo {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2px solid var(--yellow);
  overflow: hidden; flex-shrink: 0;
  background: var(--bg);
}
.winner-photo img { width: 100%; height: 100%; object-fit: cover; }
.winner-info {}
.winner-label { font-size: 0.65rem; color: #C07800; font-weight: 700; font-family: var(--font-en); letter-spacing: 0.1em; }
.winner-name { font-size: 1rem; font-weight: 700; }

/* === LIVE BANNER === */
.live-banner {
  margin: 16px 0;
  background: linear-gradient(135deg, #1A1A2E 0%, #2a1030 100%);
  color: #FFF;
  border: none;
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  animation: liveBorderPulse 3s ease infinite;
  box-shadow: 0 4px 20px rgba(26,26,46,0.3);
}
@keyframes liveBorderPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(26,26,46,0.3); }
  50% { box-shadow: 0 4px 28px rgba(255,45,120,0.3); }
}
.live-inner { display: flex; align-items: center; gap: 14px; }
.live-icon { width: 48px; height: 48px; flex-shrink: 0; }
.live-body { flex: 1; min-width: 0; }
.live-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.live-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: #FF0000; color: white;
  font-family: var(--font-en); font-size: 0.7rem; font-weight: 700;
  padding: 2px 8px; border-radius: 4px;
  letter-spacing: 0.05em;
}
.live-dot {
  width: 6px; height: 6px;
  background: white; border-radius: 50%;
  animation: livePulse 1.5s ease infinite;
}
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.live-label { font-weight: 700; font-size: 0.9rem; color: #FFF; }
.live-title { font-size: 0.8rem; color: rgba(255,255,255,0.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-btns { display: flex; gap: 8px; margin-top: 10px; }
.live-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 0.78rem; font-weight: 600;
  transition: var(--transition);
}
.live-btn-yt { background: #FF0000; color: white; }
.live-btn-x { background: rgba(255,255,255,0.15); color: white; border: 1px solid rgba(255,255,255,0.3); }

/* === POS RANKING === */
.pos-header { padding: var(--space-lg) 0; text-align: center; }
.pos-title { font-family: var(--font-en); font-size: 1.6rem; font-weight: 700; }
.pos-sub { font-size: 0.85rem; color: var(--text-sub); margin-top: 4px; }

.pos-podium { display: flex; justify-content: center; align-items: flex-end; gap: 12px; margin: 24px 0; }
.pos-podium-item { text-align: center; transition: var(--transition); }
.pos-podium-item.rank-1 { order: 2; }
.pos-podium-item.rank-2 { order: 1; }
.pos-podium-item.rank-3 { order: 3; }
.podium-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-en); font-weight: 700;
  margin: 0 auto 8px;
  border: 3px solid var(--border);
  font-size: 1.2rem;
  color: var(--text);
}
.rank-1 .podium-avatar { width: 80px; height: 80px; border-color: #C07800; font-size: 1.6rem; }
.rank-2 .podium-avatar { border-color: #A0A0A0; }
.rank-3 .podium-avatar { border-color: #CD7F32; }
.podium-rank {
  font-family: var(--font-en); font-size: 0.75rem; font-weight: 700;
  color: var(--text-caption); margin-bottom: 4px;
}
.rank-1 .podium-rank { color: #C07800; font-size: 1rem; }
.podium-name { font-size: 0.8rem; font-weight: 700; margin-bottom: 2px; }
.podium-pts { font-family: var(--font-en); font-size: 0.85rem; font-weight: 700; color: var(--accent); }

.pos-list { margin-top: 16px; }
.pos-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  animation: cardIn 0.3s var(--bounce) backwards;
}
.pos-rank {
  font-family: var(--font-en);
  font-size: 0.85rem; font-weight: 700;
  width: 28px; text-align: center;
  color: var(--text-caption);
}
.pos-name { flex: 1; font-weight: 600; font-size: 0.9rem; }
.pos-pts {
  font-family: var(--font-en);
  font-size: 1rem; font-weight: 700; color: var(--accent);
}
.pos-pts-unit { font-size: 0.7rem; color: var(--text-caption); font-weight: 500; margin-left: 2px; }

/* === GALLERY === */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 16px 0;
}
.gallery-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--bg-card);
  cursor: pointer;
  transition: transform 0.2s var(--bounce);
  animation: cardIn 0.4s var(--bounce) backwards;
}
.gallery-item:active { transform: scale(0.96); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-item.video {
  position: relative;
  aspect-ratio: 16/9;
  grid-column: span 2;
}
.gallery-play-btn {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.3);
}
.gallery-play-btn svg { width: 48px; height: 48px; }

/* === INFO === */
.info-section { margin-bottom: var(--space-xl); }
.info-section h3 { font-size: 1rem; margin-bottom: var(--space-md); }
.info-link-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 8px;
  transition: var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.info-link-card:active { transform: scale(0.98); }
.info-link-inner { display: flex; align-items: center; gap: 14px; }
.info-link-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.info-link-text { flex: 1; min-width: 0; }
.info-link-name { font-weight: 700; font-size: 0.9rem; }
.info-link-desc { font-size: 0.75rem; color: var(--text-caption); }

/* === MODAL === */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg-modal);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn 0.2s ease;
  overflow-y: auto;
  padding: 60px 0 0;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
  width: 100%; max-width: 520px;
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  animation: slideUp 0.3s var(--bounce);
  box-shadow: 0 -4px 30px rgba(0,0,0,0.15);
}
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-handle {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 20px;
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  border-radius: 50%;
  color: var(--text-sub);
  z-index: 10;
}

/* Modal result */
.modal-winner-section {
  text-align: center;
  padding: 20px 0;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(245,166,35,0.06), rgba(255,45,120,0.03));
  border-radius: var(--radius-lg);
}
.modal-winner-photo {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 3px solid var(--yellow);
  margin: 0 auto 12px;
  overflow: hidden;
  background: var(--bg);
}
.modal-winner-photo img { width: 100%; height: 100%; object-fit: cover; }
.modal-winner-crown { font-size: 1.8rem; margin-bottom: 8px; }
.modal-winner-name { font-size: 1.2rem; font-weight: 700; }
.modal-winner-label { font-family: var(--font-en); font-size: 0.7rem; color: #C07800; letter-spacing: 0.15em; font-weight: 700; margin-top: 4px; }

.modal-results-list { margin-bottom: 20px; }
.modal-result-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}
.modal-result-rank {
  font-family: var(--font-en);
  font-size: 0.85rem; font-weight: 700;
  width: 28px; text-align: center;
  color: var(--text-caption);
}
.modal-result-rank.top { color: #C07800; }
.modal-result-name { flex: 1; font-weight: 600; font-size: 0.9rem; }
.modal-result-pts { font-family: var(--font-en); font-weight: 700; color: var(--accent); }

.modal-detail-img {
  margin-top: 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}
.modal-detail-img img { width: 100%; display: block; }
.modal-carousel {
  margin-top: 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}
.modal-carousel img { width: 100%; display: block; }

.modal-btn {
  width: 100%; margin-top: 16px;
  padding: 14px;
  background: var(--accent);
  color: white; font-weight: 700;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  transition: var(--transition);
}
.modal-btn:active { transform: scale(0.97); }
.modal-btn-secondary {
  width: 100%; margin-top: 8px;
  padding: 14px;
  background: var(--bg-card);
  color: var(--text-sub); font-weight: 600;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  border: 1px solid var(--border);
}

/* === SECTION HEADERS === */
.section { padding: var(--space-lg) 0; }
.section-title {
  font-size: 1.1rem; font-weight: 700;
  margin-bottom: var(--space-md);
}

/* === TOAST === */
.toast-notify {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%) translateY(-20px);
  z-index: 500;
  padding: 12px 24px; border-radius: var(--radius-md);
  font-size: 0.85rem; font-weight: 600;
  opacity: 0; transition: all 0.4s var(--bounce);
  max-width: 90%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.toast-notify.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-notify.info { background: var(--green); color: #FFF; }
.toast-notify.warn { background: var(--warning); color: #FFF; }

/* === PULL-TO-REFRESH === */
#pull-refresh {
  position: fixed; top: 0; left: 0; right: 0;
  height: 0; display: flex; align-items: center; justify-content: center;
  background: var(--bg-secondary);
  z-index: 999; overflow: hidden;
  transition: height 0.2s ease;
  font-size: 0.8rem; color: var(--text-caption);
}

/* === SEARCH === */
.search-wrap {
  position: relative; margin-bottom: var(--space-md);
}
.search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-caption);
}
.search-input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}
.search-input:focus { border-color: var(--green); }
.search-input::placeholder { color: var(--text-caption); }

/* === UTILITIES === */
.text-green { color: var(--green); }
.text-pink { color: var(--pink); }
.text-orange { color: var(--orange); }
.text-purple { color: var(--purple); }
.text-yellow { color: var(--yellow); }
.text-caption { color: var(--text-caption); }
.text-sub { color: var(--text-sub); }

/* Ink transition */
.page-transition {
  animation: inkSplash 0.4s ease;
}
@keyframes inkSplash {
  0% { opacity: 0; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1); }
}

/* Gallery modal */
.gallery-modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.95);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.gallery-modal-img {
  max-width: 100%; max-height: 85vh;
  border-radius: var(--radius-md);
  object-fit: contain;
}

/* === PAINT / INK EFFECTS === */

/* Ink splat decorations for sections */
.section-mascot {
  display: inline-block;
  width: 28px; height: 28px;
  vertical-align: middle;
  margin-right: 4px;
  filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.1));
}
.section-mascot img { width: 100%; height: 100%; object-fit: contain; }

/* Paint drip on tournament cards */
.tournament-card::before {
  content: '';
  position: absolute;
  top: -2px; left: 16px;
  width: 50px; height: 8px;
  border-radius: 0 0 12px 12px;
  opacity: 0;
  transition: opacity 0.3s;
}
.tournament-card::after {
  content: '';
  position: absolute;
  top: -2px; left: 50px;
  width: 20px; height: 5px;
  border-radius: 0 0 8px 8px;
  opacity: 0;
  transition: opacity 0.3s;
}
.tournament-card.state-open::before {
  opacity: 0.8;
  background: var(--green);
}
.tournament-card.state-open::after {
  opacity: 0.5;
  background: var(--green);
  left: 75px;
}
.tournament-card.state-finished::before {
  opacity: 0.5;
  background: var(--yellow);
}
.tournament-card.state-finished::after {
  opacity: 0.3;
  background: var(--yellow);
  left: 70px;
}

/* Paint dot accents on day tabs */
.day-tab::after {
  content: '';
  position: absolute;
  bottom: 4px; right: 6px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s var(--bounce);
  transform: scale(0);
}
.day-tab.active::after {
  opacity: 0.5;
  transform: scale(1);
}

/* Mascot peek decoration for empty states */
.empty-mascot {
  width: 80px; height: 80px;
  margin: 0 auto 16px;
  opacity: 0.3;
  animation: peekBounce 2s ease infinite;
}
.empty-mascot img { width: 100%; height: 100%; object-fit: contain; }
@keyframes peekBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(5deg); }
}

/* Corner mascot peeking */
.corner-mascot {
  position: fixed;
  z-index: 1;
  pointer-events: none;
  opacity: 0.08;
  display: none; /* Hide on desktop, show on mobile */
}
@media (max-width: 600px) {
  .corner-mascot { display: block; }
}
.corner-mascot.top-right {
  top: 60px; right: -15px;
  width: 70px; transform: rotate(-15deg);
}
.corner-mascot.bottom-left {
  bottom: 90px; left: -10px;
  width: 60px; transform: rotate(10deg);
}

/* Ink splatter spots on bg */
.ink-spot {
  position: absolute;
  border-radius: 50% 40% 55% 45%;
  pointer-events: none;
  z-index: 0;
}

/* Paint-style section titles */
.section-title-paint {
  font-family: var(--font-en);
  font-size: 1.1rem; font-weight: 700;
  margin-bottom: var(--space-md);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.section-title-paint::after {
  content: '';
  display: inline-block;
  width: 24px; height: 3px;
  border-radius: 2px;
  background: var(--accent);
  margin-left: 4px;
}

/* Hero paint splatters — now handled by splatters.js SVGs */
.hero-splats {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
}

/* POS podium paint effect */
.pos-podium-item.rank-1::before {
  content: '';
  position: absolute;
  top: -10px; left: 50%; transform: translateX(-50%);
  width: 100px; height: 8px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: 4px;
  opacity: 0.2;
}
.pos-podium-item { position: relative; }

/* Scattered mascot images in cards */
.card-mascot-bg {
  position: absolute;
  bottom: -5px; right: -5px;
  width: 50px; height: 50px;
  opacity: 0.04;
  pointer-events: none;
  transform: rotate(10deg);
}
.card-mascot-bg img { width: 100%; height: 100%; object-fit: contain; }
