/**
 * Version Notes:
 * File: styles.css
 * Version: 0.0.9
 * Last Modified: 2026-03-14 02:55 PM
 * Changes:
 * - Added .prompt-trainer-name, .prompt-game-name title bar styles
 * - Mobile: side-by-side cards (row layout, 180px min-height, 130px max img)
 * - Reduced prompt-banner padding and font sizes on mobile
 * - Added multiplayer battle phase indicator bar + transition flash
 * - Added directional battle guess review result layout
 * - Added Dex Entry prompt card and battle HP bar / cry polish hooks
 * - Centered results layout on mobile and compacted HWDYKM review cards
 * - Added sound toggle, Rotom/Smeargle mode art, and Dex results cards
 * - Moved result actions into a topbar and added same-room replay flow
 * - Simplified Draw Duel header, added layer previews, and tightened result summaries
 */

:root { --primary: #e74c3c; --secondary: #3498db; --bg: #f0f2f6; --text: #2c3e50; --success: #2ecc71; --accent: #f1c40f; }
body { font-family: 'Poppins', sans-serif; background-color: var(--bg); color: var(--text); margin: 0; padding: 20px; display: flex; flex-direction: column; align-items: center; min-height: 100vh; }
h1 { font-weight: 900; font-size: 2.5rem; text-align: center; margin-bottom: 5px; color: var(--primary); text-transform: uppercase; letter-spacing: 2px; }
.site-header { text-align: center; margin-bottom: 6px; }
.site-logo { max-width: 600px; width: 100%; height: auto; margin: 0 auto 2px; display: block; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15)); }
p.subtitle { text-align: center; font-size: 1.1rem; margin-bottom: 4px; color: #7f8c8d; margin-top: 0; }
.brought-to-you { text-align: center; font-size: 0.78rem; color: #a0aab4; margin: 0 0 10px 0; letter-spacing: 0.3px; font-weight: 500; }
.brought-to-you strong { color: #e74c3c; font-weight: 800; }

/* Social bar */
.social-bar { display: flex; gap: 10px; justify-content: center; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.social-link { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(44,62,80,0.08); color: #5a6d85; text-decoration: none; transition: all 0.25s ease; border: none; padding: 0; margin: 0; }
.social-link:hover { background: var(--primary); color: #fff; transform: translateY(-3px); box-shadow: 0 4px 12px rgba(231,76,60,0.35); }
.social-link svg { display: block; }
.screen { display: none; width: 100%; max-width: 1200px; animation: fadeIn 0.4s ease-in-out; }
.screen.active { display: block; }
.sound-toggle-btn { position: fixed; right: 18px; bottom: 18px; z-index: 2400; width: auto; margin: 0; padding: 10px 14px; border-radius: 999px; border: 2px solid rgba(29,53,87,0.12); background: rgba(255,255,255,0.96); color: #1d3557; font-size: 0.92rem; font-weight: 900; letter-spacing: 0.2px; box-shadow: 0 10px 24px rgba(0,0,0,0.16); backdrop-filter: blur(10px); }
.sound-toggle-btn:hover { background: #fff4df; color: #8a4b00; transform: translateY(-2px); }
.sound-toggle-btn.muted { background: rgba(255,255,255,0.98); color: #7f8c8d; }

.box-panel { background: white; padding: 40px; border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); max-width: 780px; margin: 0 auto; text-align: center; }

/* Trainer Name Section */
#trainer-name-section { margin-bottom: 16px; }
.trainer-name-label { display: block; text-align: left; font-weight: 800; font-size: 0.95rem; margin-bottom: 6px; color: var(--text); }
.required-star { color: var(--primary); font-weight: 900; }
.trainer-name-row { display: flex; align-items: center; gap: 8px; }
.trainer-name-row #trainer-name { flex: 1; margin: 0; font-size: 1.1rem; font-weight: 600; }
.trainer-name-row #trainer-name:invalid:not(:focus):not(:placeholder-shown) { border-color: var(--primary); }
.lang-select-mini { width: auto !important; min-width: 56px; margin: 0 !important; padding: 12px 8px !important; font-size: 0.85rem !important; font-weight: 700; flex: 0 0 auto; text-align: center; background: var(--bg); }
.trainer-status-msg { display: none; text-align: left; font-weight: 700; font-size: 0.85rem; margin-top: 4px; color: var(--success); }
#trainer-name.shake { animation: shake 0.4s ease; border-color: var(--primary) !important; }
@keyframes shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }
input, select, button { font-family: 'Poppins', sans-serif; padding: 15px 20px; font-size: 1.1rem; border-radius: 10px; border: 2px solid #ddd; width: 100%; margin-bottom: 20px; box-sizing: border-box; outline: none; }
input[type="range"] { padding: 0; }
input[type="color"] { width: 46px; height: 46px; padding: 0; border: 2px solid #ddd; border-radius: 8px; cursor: pointer; background: none; }
input:focus, select:focus { border-color: var(--primary); }
button { background: var(--primary); color: white; border: none; font-weight: bold; cursor: pointer; transition: 0.2s; }
button:hover { background: #c0392b; transform: translateY(-2px); }
button:disabled { background: #bdc3c7; cursor: not-allowed; transform: none; }

.tabs { display: flex; gap: 10px; margin-bottom: 20px; }
.tab { flex: 1; background: #eee; color: #2c3e50; padding: 10px; border-radius: 10px; cursor: pointer; font-weight: bold; }
.tab:hover { background: var(--secondary); color: #fff !important; transform: none; }
.tab.active { background: var(--secondary); color: #fff !important; }

/* Game Mode Cards */
.game-mode-card { background: linear-gradient(135deg, #f8faff 0%, #eef3fb 50%, #e8effa 100%); border: 3px solid #d4dce8; border-radius: 16px; padding: 14px 10px 10px; cursor: pointer; text-align: center; transition: all 0.2s; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.game-mode-card:hover { border-color: var(--secondary); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.12); background: linear-gradient(135deg, #edf3ff 0%, #dce6f9 100%); }
.game-mode-card.active { border-color: var(--secondary); background: linear-gradient(135deg, #d6e8ff 0%, #b8d4ff 100%); box-shadow: 0 4px 14px rgba(52, 120, 246, 0.25); }
.game-mode-card img { width: 80px; height: 80px; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(0,0,0,0.15)); }
.game-mode-card .card-label { font-weight: 800; font-size: 0.82rem; line-height: 1.2; color: #2c3e50; }
.mode-icon-dex { position: relative; width: 92px; height: 92px; display: flex; align-items: center; justify-content: center; }
.mode-icon-dex .mode-dex-device { position: absolute; margin: 0; object-fit: contain; filter: drop-shadow(0 10px 16px rgba(0,0,0,0.2)); }
.mode-icon-dex .mode-dex-device.back { width: 58px; height: 58px; top: 2px; right: 2px; opacity: 0.96; transform: rotate(8deg); }
.mode-icon-dex .mode-dex-device.front { width: 76px; height: 76px; left: 2px; bottom: 10px; transform: rotate(-7deg); }
.mode-dex-badge { position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%); padding: 4px 8px; border-radius: 999px; background: linear-gradient(135deg, #fff1aa 0%, #ffd55c 100%); color: #8a4b00; font-size: 0.62rem; font-weight: 900; letter-spacing: 0.7px; white-space: nowrap; box-shadow: 0 6px 14px rgba(0,0,0,0.14); }
.mode-icon-draw { position: relative; width: 92px; height: 92px; display: flex; align-items: center; justify-content: center; }
.mode-icon-draw img { width: 84px; height: 84px; object-fit: contain; margin: 0; filter: drop-shadow(0 10px 18px rgba(0,0,0,0.2)); }
.mode-draw-badge { position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%); padding: 4px 8px; border-radius: 999px; background: linear-gradient(135deg, #d9f7e7 0%, #7dd3a7 100%); color: #155e3a; font-size: 0.62rem; font-weight: 900; letter-spacing: 0.7px; white-space: nowrap; box-shadow: 0 6px 14px rgba(0,0,0,0.14); }

/* Option Button Groups */
.option-btn-group { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.opt-btn { padding: 8px 14px; border-radius: 10px; border: 2px solid #d0d5dd; background: #fff; color: #344054; font-weight: 700; font-size: 0.85rem; cursor: pointer; transition: all 0.15s; width: auto; flex: 0 0 auto; }
.opt-btn:hover { background: #edf2f7; border-color: #98a2b3; }
.opt-btn.active { background: var(--secondary); color: #fff; border-color: var(--secondary); }

/* Type Buttons */
.type-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 8px; }
.type-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px 5px; border-radius: 10px; border: 2px solid rgba(0,0,0,0.12); cursor: pointer; transition: all 0.15s; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.type-btn img { width: 24px; height: 24px; object-fit: contain; }
.type-btn span { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.5px; }
.type-btn:hover { transform: scale(1.08); box-shadow: 0 3px 10px rgba(0,0,0,0.2); }
.type-btn.active { border-color: #fff; box-shadow: 0 0 0 3px var(--secondary), 0 3px 12px rgba(0,0,0,0.25); transform: scale(1.05); }

/* Color Buttons */
.color-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 8px; }
.color-btn { padding: 10px 6px; border-radius: 10px; border: 2px solid rgba(0,0,0,0.15); cursor: pointer; transition: all 0.15s; font-weight: 800; font-size: 0.72rem; text-align: center; text-transform: capitalize; }
.color-btn:hover { transform: scale(1.06); box-shadow: 0 3px 10px rgba(0,0,0,0.2); }
.color-btn.active { border-color: #fff; box-shadow: 0 0 0 3px var(--secondary), 0 3px 12px rgba(0,0,0,0.25); transform: scale(1.05); }

.lobby-area { background: #f8f9fa; padding: 20px; border-radius: 10px; margin-bottom: 20px; border: 2px dashed #bdc3c7; }
.room-code { font-size: 2rem; font-weight: 900; color: var(--secondary); letter-spacing: 5px; margin: 10px 0; }

/* Battle Arena */
.battle-header { display: flex; justify-content: center; align-items: center; margin-bottom: 20px; font-weight: bold; font-size: 1.2rem; gap: 30px; flex-wrap: wrap; text-align: center; }
.wtp-scoreboard { background: #fff; border-radius: 16px; padding: 12px 16px; margin-bottom: 14px; box-shadow: 0 8px 20px rgba(0,0,0,0.08); border: 2px solid #e3e7ee; }
.wtp-board-head { display:flex; justify-content:space-between; align-items:center; gap:12px; font-weight:800; font-size:1.05rem; flex-wrap:wrap; margin-bottom:8px; }
.wtp-score-lines { display:grid; gap:8px; }
.wtp-score-line { display:grid; grid-template-columns:minmax(180px,1.5fr) auto minmax(110px,1fr); align-items:center; gap:12px; background:#f7f9fc; border:1px solid #e4e9f1; border-radius:10px; padding:9px 12px; }
.wtp-score-line.leader { border-color:#2ecc71; box-shadow:0 0 0 2px rgba(46,204,113,0.18); font-weight:800; }
.wtp-line-name { text-align:left; font-weight:800; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wtp-line-score { font-size:clamp(1.55rem,3vw,2.25rem); font-weight:900; line-height:1; color:#1f3652; min-width:54px; text-align:center; }
.wtp-line-streak { text-align:right; font-size:0.84rem; font-weight:700; color:#586d86; }
.wtp-line-streak .small { display:block; font-size:0.75rem; opacity:0.9; }
.lobby-card { background:#fff; border-radius:16px; padding:16px; border:2px solid #e3e7ee; box-shadow:0 8px 20px rgba(0,0,0,0.08); }
.lobby-player-row { display:flex; align-items:center; justify-content:space-between; gap:10px; background:#f8fafd; border:1px solid #e4e9f1; border-radius:10px; padding:10px 12px; }
.arena { display: flex; position: relative; gap: 20px; height: 75vh; min-height: 500px; }
.pokemon-card { flex: 1; background: white; border: 6px solid transparent; border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; position: relative; transition: 0.2s; overflow: hidden; padding-bottom: 40px; }
.pokemon-card:hover { transform: scale(1.02); border-color: #bdc3c7; }
.pokemon-card.selected { border-color: var(--success); }
.pokemon-card.card-winner { box-shadow: 0 16px 36px rgba(46, 204, 113, 0.18); }
.pokemon-card.card-loser { background: linear-gradient(180deg, #ffffff 0%, #fff2f0 100%); }
.pokemon-card img { max-width: 90%; max-height: 70%; object-fit: contain; filter: drop-shadow(0 10px 15px rgba(0,0,0,0.2)); transition: 0.2s; }
.pokemon-card:hover img { filter: drop-shadow(0 15px 20px rgba(0,0,0,0.3)); }
.pokemon-name { font-size: 2rem; font-weight: 900; text-transform: uppercase; margin-top: 15px; letter-spacing: 2px; text-align: center;}
.card-hp-shell { position: absolute; left: 18px; right: 18px; bottom: 14px; height: 14px; border-radius: 999px; background: rgba(31, 54, 82, 0.12); box-shadow: inset 0 0 0 2px rgba(31, 54, 82, 0.08); overflow: hidden; }
.card-hp-fill { width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #34d399 0%, #facc15 64%, #f97316 100%); transform-origin: left center; transform: scaleX(1); transition: transform 0.42s ease, opacity 0.42s ease, filter 0.42s ease; }
.card-hp-fill.depleted { transform: scaleX(0.03); opacity: 0.34; filter: saturate(0.55); }

.vs-badge { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #2c3e50; color: white; width: 80px; height: 80px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 2rem; font-weight: 900; border: 6px solid var(--bg); z-index: 10; }

.overlay-feedback { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(255,255,255,0.85); opacity: 0; pointer-events: none; transition: 0.3s; z-index: 20; }
.pokemon-card.show-feedback .overlay-feedback { opacity: 1; }
.check-mark { font-size: 8rem; color: var(--success); text-shadow: 0 0 20px white; }
#round-result-overlay { position: fixed; inset: 0; background: rgba(44, 62, 80, 0.75); display: none; align-items: center; justify-content: center; z-index: 1000; }
#round-result-overlay.show { display: flex; }
#round-result-text { font-size: clamp(3rem, 10vw, 6rem); font-weight: 900; color: #fff; padding: 20px 40px; border-radius: 20px; }
#round-result-text.match { background: var(--success); }
#round-result-text.fail { background: var(--primary); }

#loading-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(240, 242, 246, 0.9); z-index: 50; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: bold; border-radius: 20px; text-align:center; flex-direction:column; }
#loading-overlay span { font-size: 1rem; color: #7f8c8d; margin-top: 10px;}

.prompt-banner { background: var(--secondary); color: white; text-align: center; padding: 12px 14px; border-radius: 15px; margin-bottom: 15px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:10px; }
.prompt-center { display:flex; flex-direction:column; align-items:center; justify-content:center; min-width:0; }
.prompt-title { text-align:center; font-size:1.9rem; font-weight:900; line-height:1.1; }
.prompt-trainer-name { display:block; text-align:center; font-size:1.6rem; font-weight:900; line-height:1.1; text-transform:uppercase; letter-spacing:1px; text-shadow: 0 2px 8px rgba(0,0,0,0.18); }
.prompt-game-name { display:block; text-align:center; font-size:1.25rem; font-weight:700; line-height:1.2; margin-top:2px; opacity:0.95; }
.prompt-subtitle { text-align:center; font-size:0.9rem; font-weight:700; opacity:0.95; margin-top:4px; line-height:1.2; }
.drawduel-timer-line { order: 1; display: inline-flex; align-items: center; justify-content: center; margin-top: 6px; padding: 7px 16px; border-radius: 999px; background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.38); color: #fffdf0; font-size: 1.3rem; font-weight: 900; letter-spacing: 0.4px; box-shadow: 0 8px 18px rgba(0,0,0,0.14); }
#drawduel-phase-subtitle { order: 2; max-width: 760px; }
.room-code-banner { display:none; margin-top:6px; padding:5px 12px; border-radius:999px; background:rgba(255,255,255,0.24); border:1px solid rgba(255,255,255,0.45); color:#fff; font-weight:900; font-size:1.02rem; letter-spacing:0.6px; }
.topbar-actions { display:flex; gap:8px; align-items:center; }
.topbar-actions.left { justify-content:flex-start; flex-wrap:wrap; }
.topbar-actions.right { justify-content:flex-end; }
.topbar-btn { width:auto; margin:0; padding:9px 12px; font-size:0.9rem; border-radius:10px; background:rgba(255,255,255,0.22); border:1px solid rgba(255,255,255,0.45); color:#fff; }
.topbar-btn:hover { background:rgba(255,255,255,0.3); transform:none; }
.topbar-btn.end { background: rgba(231, 76, 60, 0.35); }
.topbar-code-chip { width:auto; margin:0; padding:10px 15px; border-radius:12px; border:2px solid rgba(255,255,255,0.72); background:linear-gradient(135deg, #fff7bf 0%, #ffe07a 100%); color:#1d3557; font-weight:900; font-size:1rem; letter-spacing:0.7px; text-transform:uppercase; box-shadow:0 8px 18px rgba(0,0,0,0.18); }
.battle-phase-indicator { display:flex; align-items:center; justify-content:center; gap:10px; min-height:54px; margin:0 0 14px 0; padding:14px 20px; border-radius:14px; border:3px solid transparent; font-weight:900; font-size:1.15rem; letter-spacing:0.5px; text-align:center; text-transform:uppercase; transition:background 0.3s, border-color 0.3s, color 0.3s; }
.battle-phase-indicator.hidden { display:none; }
.battle-phase-indicator .phase-icon { font-size:1.5rem; flex-shrink:0; }
.battle-phase-indicator.self { background:linear-gradient(135deg, rgba(46,204,113,0.22) 0%, rgba(39,174,96,0.12) 100%); border-color:rgba(46,204,113,0.7); color:#14613b; animation:phaseGlowSelf 2s ease-in-out infinite; }
.battle-phase-indicator.guess { background:linear-gradient(135deg, rgba(231,76,60,0.20) 0%, rgba(192,57,43,0.12) 100%); border-color:rgba(231,76,60,0.7); color:#922b21; animation:phaseGlowGuess 1.5s ease-in-out infinite; }
@keyframes phaseGlowSelf { 0%,100% { box-shadow:0 4px 14px rgba(46,204,113,0.15); } 50% { box-shadow:0 4px 22px rgba(46,204,113,0.4); } }
@keyframes phaseGlowGuess { 0%,100% { box-shadow:0 4px 14px rgba(231,76,60,0.15); } 50% { box-shadow:0 4px 22px rgba(231,76,60,0.45); } }
.battle-phase-flash { position:fixed; top:0; left:0; right:0; bottom:0; z-index:2700; display:none; padding:0; font-weight:900; font-size:clamp(1.4rem, 3.5vw, 2.2rem); letter-spacing:0.5px; text-align:center; color:#fff; opacity:0; pointer-events:none; flex-direction:column; align-items:center; justify-content:center; }
.battle-phase-flash .flash-inner { padding:28px 32px; border-radius:22px; max-width:min(90vw, 500px); box-shadow:0 20px 50px rgba(0,0,0,0.35); }
.battle-phase-flash .flash-icon { font-size:3rem; margin-bottom:10px; display:block; }
.battle-phase-flash.show { display:flex; animation:battlePhaseFlashIn 2s ease forwards; }
.battle-phase-flash.guess { background:rgba(0,0,0,0.55); }
.battle-phase-flash.guess .flash-inner { background:linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); }
.battle-phase-flash.self { background:rgba(0,0,0,0.55); }
.battle-phase-flash.self .flash-inner { background:linear-gradient(135deg, #2ecc71 0%, #27ae60 100%); }
@keyframes battlePhaseFlashIn {
  0% { opacity:0; }
  10% { opacity:1; }
  75% { opacity:1; }
  100% { opacity:0; }
}
#live-status-toast {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2600;
  display: none;
  min-width: 280px;
  max-width: min(92vw, 760px);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.98rem;
  text-align: center;
  color: #fff;
  background: rgba(44, 62, 80, 0.92);
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 8px 18px rgba(0,0,0,0.25);
  pointer-events: none;
}
.binary-toggle { display:flex; gap:10px; margin-bottom:14px; }
.binary-toggle button { margin:0; border:2px solid #d7dbe0; background:#eef2f6; color:#2c3e50; font-weight:800; padding:10px 16px; font-size:0.95rem; }
.binary-toggle button.active { background:#2ecc71; color:#fff; border-color:#27ae60; }
#wtp-image-wrap { position: relative; width: 100%; max-width: 420px; margin: 0 auto; }
#dex-entry-wrap { width: 100%; max-width: 620px; margin: 0 auto; }
.dex-entry-card { position: relative; background: linear-gradient(145deg, #fffef4 0%, #fff6d5 100%); border: 3px solid #f0d37b; border-radius: 18px; padding: 24px 22px 20px; min-height: 260px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.7), 0 14px 28px rgba(240, 195, 75, 0.16); }
.dex-entry-text { font-size: 1.12rem; font-weight: 700; line-height: 1.7; color: #364a63; text-align: left; white-space: pre-wrap; }
.dex-entry-version { margin-top: 16px; font-size: 0.82rem; font-weight: 900; letter-spacing: 0.55px; color: #8a4b00; text-transform: uppercase; text-align: right; }
.quiz-answer-overlay { position:absolute; inset:0; display:none; align-items:center; justify-content:center; font-size:clamp(2rem,8vw,4rem); font-weight:900; color:#fff; border-radius:12px; text-shadow:0 3px 8px rgba(0,0,0,0.45); }
.quiz-answer-overlay.show { display:flex; }
.quiz-answer-overlay.correct { background:rgba(46,204,113,0.75); }
.quiz-answer-overlay.wrong { background:rgba(231,76,60,0.75); }
.dex-entry-card .quiz-answer-overlay { border-radius: 15px; }

/* Results */
#summary-card { width: 100%; max-width: 800px; box-sizing: border-box; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 40px; border-radius: 20px; box-shadow: 0 15px 40px rgba(0,0,0,0.2); margin-bottom: 30px; color: white; text-align: center; }
#summary-card h2 { font-size: 2.5rem; text-align: center; margin-top: 0; margin-bottom: 5px; text-shadow: 2px 2px 4px rgba(0,0,0,0.2); }
.trainer-tag { text-align: center; font-size: 1.2rem; opacity: 0.9; margin-bottom: 30px; }

.stats-grid { display: flex; justify-content: space-between; background: rgba(255, 255, 255, 0.15); padding: 20px; border-radius: 15px; margin-bottom: 30px; backdrop-filter: blur(5px); }
.stat-box { flex: 1; text-align: center; border-right: 2px solid rgba(255,255,255,0.2); }
.stat-box:last-child { border-right: none; }
.stat-label { font-size: 0.9rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; opacity: 0.8; }
.stat-value { font-size: 1.8rem; font-weight: 900; margin-top: 5px; color: #f1c40f;}

.multiplayer-results { width: 100%; box-sizing: border-box; background: rgba(0,0,0,0.2); padding: 20px; border-radius: 15px; margin-bottom: 30px; text-align: center; }
.multiplayer-results h3 { margin: 0 0 15px 0; color: #f1c40f; }

#card-images { width: 100%; box-sizing: border-box; display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; background: rgba(255, 255, 255, 0.9); padding: 30px; border-radius: 15px; }
#card-images img { width: 120px; height: 120px; object-fit: contain; filter: drop-shadow(0 5px 10px rgba(0,0,0,0.2)); }
.favorites-section { margin-bottom: 18px; }
.favorites-title { font-size: 1.2rem; font-weight: 800; color: #2c3e50; margin: 0 0 10px 0; text-align: center; }
.favorites-grid { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; }
.favorite-item { width: 96px; display: inline-flex; flex-direction: column; align-items: center; text-align: center; }
.favorite-item img { width: 82px !important; height: 82px !important; margin-bottom: 6px; }
.favorite-item .favorite-name { font-size: 0.72rem; font-weight: 700; line-height: 1.15; color: #2c3e50; word-break: break-word; }
.prediction-results { display:grid; gap:16px; width:100%; }
.prediction-round { display:grid; grid-template-columns:auto 1fr 1fr; gap:12px; align-items:stretch; padding:14px; border-radius:18px; background:#f7f9fc; border:2px solid #dbe3ef; }
.prediction-round-head { display:flex; align-items:center; justify-content:center; min-width:50px; font-weight:900; font-size:0.9rem; color:#6c7f96; letter-spacing:0.4px; }
.prediction-panel { display:flex; flex-direction:column; gap:10px; padding:14px; border-radius:16px; background:#fff; border:2px solid #dbe4ef; box-shadow:0 8px 18px rgba(0,0,0,0.06); }
.prediction-panel.correct { border-color:rgba(46,204,113,0.6); background:linear-gradient(135deg, rgba(46,204,113,0.1) 0%, rgba(46,204,113,0.03) 100%); }
.prediction-panel.wrong { border-color:rgba(231,76,60,0.28); background:linear-gradient(135deg, rgba(231,76,60,0.08) 0%, rgba(231,76,60,0.03) 100%); }
.prediction-panel-title { font-size:0.92rem; font-weight:900; color:#23364d; text-align:center; line-height:1.25; }
.prediction-card-row { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); gap:10px; align-items:center; }
.prediction-pokemon { display:flex; flex-direction:column; align-items:center; gap:6px; padding:12px 10px; border-radius:14px; background:rgba(255,255,255,0.82); border:1px solid #e0e7f0; text-align:center; min-width:0; }
.prediction-pokemon.actual { background:rgba(255,255,255,0.96); border-color:#c9d7ea; box-shadow:inset 0 0 0 1px rgba(255,255,255,0.5); }
.prediction-label { font-size:0.72rem; font-weight:800; color:#6f8197; text-transform:uppercase; letter-spacing:0.45px; line-height:1.2; }
.prediction-pokemon img { width:84px; height:84px; object-fit:contain; filter:drop-shadow(0 4px 9px rgba(0,0,0,0.16)); }
.prediction-empty-thumb { width:84px; height:84px; display:flex; align-items:center; justify-content:center; border-radius:50%; background:#eef3f8; color:#90a1b5; font-size:2rem; font-weight:900; }
.prediction-name { font-size:0.95rem; font-weight:800; color:#243a55; line-height:1.15; word-break:break-word; }
.prediction-arrow { font-size:1.35rem; font-weight:900; color:#7d90a8; align-self:center; }
.prediction-result-badge { align-self:center; padding:7px 14px; border-radius:999px; font-size:0.82rem; font-weight:900; letter-spacing:0.5px; text-transform:uppercase; }
.prediction-result-badge.correct { background:#2ecc71; color:#fff; }
.prediction-result-badge.wrong { background:#e74c3c; color:#fff; }
.dex-results-sections { display: grid; gap: 18px; width: 100%; }
.dex-results-section { display: grid; gap: 12px; }
.dex-results-section-title { font-size: 1.02rem; font-weight: 900; color: #1f3652; text-align: center; letter-spacing: 0.3px; }
.dex-results-grid { display: grid; gap: 12px; width: 100%; }
.dex-result-card { position: relative; display: grid; gap: 10px; background: #fff; border-radius: 18px; padding: 16px 16px 14px; border: 2px solid #dbe4ef; box-shadow: 0 10px 20px rgba(0,0,0,0.08); color: #243a55; text-align: center; }
.dex-result-card.correct { border-color: rgba(46,204,113,0.58); background: linear-gradient(135deg, rgba(46,204,113,0.12) 0%, rgba(255,255,255,0.98) 34%); }
.dex-result-card.wrong { border-color: rgba(231,76,60,0.28); background: linear-gradient(135deg, rgba(231,76,60,0.1) 0%, rgba(255,255,255,0.98) 34%); }
.dex-result-status { justify-self: center; padding: 6px 12px; border-radius: 999px; font-size: 0.76rem; font-weight: 900; letter-spacing: 0.55px; text-transform: uppercase; }
.dex-result-status.correct { background: #2ecc71; color: #fff; }
.dex-result-status.wrong { background: #e74c3c; color: #fff; }
.dex-result-round { font-size: 0.78rem; font-weight: 900; color: #6c7f96; letter-spacing: 0.4px; }
.dex-result-question { background: rgba(255,255,255,0.9); border: 1px solid #dce6f2; border-radius: 14px; padding: 14px 12px; font-size: 0.98rem; line-height: 1.55; text-align: left; }
.dex-result-answer-block { display: grid; justify-items: center; gap: 6px; }
.dex-result-answer-label { font-size: 0.72rem; font-weight: 900; color: #6f8197; text-transform: uppercase; letter-spacing: 0.45px; }
.dex-result-answer-block img { width: 86px; height: 86px; object-fit: contain; filter: drop-shadow(0 5px 10px rgba(0,0,0,0.18)); }
.dex-result-answer-name { font-size: 1rem; font-weight: 900; color: #1f3652; }
.dex-result-guess { font-size: 0.88rem; font-weight: 700; color: #38506b; }
.dex-result-source { font-size: 0.76rem; font-weight: 800; color: #8a4b00; letter-spacing: 0.25px; }
/* Matchup Results (side-by-side) */
.matchup-results { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.matchup-row { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 12px; background: #f8f9fa; }
.matchup-row.matchup-match { background: rgba(46,204,113,0.1); border: 2px solid var(--success); }
.matchup-row.matchup-mismatch { background: rgba(231,76,60,0.06); border: 2px solid #e0e0e0; }
.matchup-round { font-weight: 900; font-size: 0.7rem; color: #7f8c8d; min-width: 28px; text-align: center; }
.matchup-card { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; padding: 6px; border-radius: 10px; }
.matchup-card img { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(0,0,0,0.15)); }
.matchup-card-match { background: rgba(46,204,113,0.12); }
.matchup-name { font-size: 0.7rem; font-weight: 700; color: #2c3e50; text-align: center; line-height: 1.15; margin-top: 2px; word-break: break-word; }
.matchup-badge { font-size: 0.6rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px; padding: 2px 8px; border-radius: 6px; margin-top: 3px; }
.badge-match { background: var(--success); color: #fff; }
.badge-me { background: var(--success); color: #fff; }
.badge-them { background: var(--primary); color: #fff; }
.matchup-vs { font-weight: 900; font-size: 0.85rem; color: #7f8c8d; min-width: 24px; text-align: center; }
.matchup-row.matchup-match .matchup-vs { color: var(--success); }

#leaderboard-box { width: 100%; box-sizing: border-box; margin-top: 20px; background: rgba(255,255,255,0.9); padding: 20px; border-radius: 15px; color: var(--text); }
#leaderboard-box h3 { margin: 0 0 10px 0; text-align: center; }
#leaderboard-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
#leaderboard-list li { display: flex; justify-content: space-between; font-weight: 700; border-bottom: 1px solid #ddd; padding-bottom: 6px; }
.result-wrapper { width: 100%; max-width: 100%; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#result-screen.active { display: flex; justify-content: center; align-items: center; }
.btn-group { display: flex; gap: 20px; justify-content: center; width: 100%; max-width: 800px; }
.result-topbar { width: 100%; max-width: 800px; box-sizing: border-box; margin-bottom: 16px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.result-topbar .prompt-title { font-size: 1.5rem; }
.result-topbar .prompt-subtitle { font-size: 0.84rem; opacity: 0.88; }
.result-topbar .topbar-btn { font-weight: 800; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
#drawduel-screen .box-panel { width: 100%; max-width: 980px; box-sizing: border-box; overflow-x: hidden; }
#draw-target-row { width: 100%; max-width: 860px; margin: 0 auto 8px auto; display: flex; align-items: center; justify-content: center; gap: 14px; }
#draw-target { margin: 0; line-height: 1.2; }
#draw-target-image { width: 100px !important; height: 100px !important; margin: 0 !important; }
/* Controls above canvas */
#draw-controls { width: 100%; max-width: 1100px; margin: 0 auto 8px auto; display: flex; flex-direction: column; gap: 6px; position: relative; }
#draw-controls.hidden { display: none !important; }
#draw-action-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
#draw-action-row .tool-btn { width: auto; min-width: 56px; margin: 0; padding: 7px 10px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border-radius: 10px; font-weight: 700; }
#draw-action-row .tool-icon { width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; }
#draw-action-row .tool-icon svg { width: 16px; height: 16px; stroke: #fff; stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
#draw-action-row .tool-btn.active { box-shadow: inset 0 0 0 2px rgba(255,255,255,0.9), 0 2px 8px rgba(0,0,0,0.18); }
#draw-action-row .tool-label { font-size: 0.78rem; line-height: 1; }
/* Compact brush toolbar */
#draw-tool-bar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; padding: 4px 0; position: relative; }
.draw-tool-group { display: flex; align-items: center; gap: 4px; }
.draw-setting-label { font-size: 0.72rem; font-weight: 800; color: #5a6d85; text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap; }
#draw-color { width: 32px !important; height: 32px !important; padding: 0; border: 2px solid #ccc; border-radius: 8px; cursor: pointer; margin: 0 !important; flex-shrink: 0; vertical-align: middle; }
#brush-preview { width: 28px; height: 28px; border-radius: 4px; background: #fff; display: block; }
.tool-btn-sm { width: 34px; height: 34px; padding: 0; margin: 0; display: flex; align-items: center; justify-content: center; background: #34495e; color: #fff; border: none; border-radius: 8px; cursor: pointer; }
.tool-btn-sm:hover { background: #4a6380; }
.tool-btn-sm.active { background: #2980b9; box-shadow: 0 0 0 2px rgba(41,128,185,0.3); }
#draw-brush-shape-btn { background: #eef3f7; border: 2px solid #d3dde6; }
#draw-tool-bar input[type="range"] { margin: 0 !important; height: 6px; margin-bottom: 0 !important; }
#draw-tool-bar .tool-btn-sm, #draw-tool-bar input, #draw-tool-bar button { margin-bottom: 0 !important; }
#draw-zoom-level { font-size: 0.65rem; cursor: default; }
/* Popups */
.draw-popup { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); z-index: 200; background: #fff; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.22); padding: 12px; min-width: 160px; }
.draw-popup-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; }
.draw-popup-grid input[type="range"] { width: 100%; min-width: 100px; margin: 0; height: 6px; }
.draw-shape-grid { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.draw-shape-opt { width: 36px; height: 36px; padding: 3px; margin: 0; border: 2px solid #d3dde6; border-radius: 8px; background: #eef3f7; color: #34495e; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.draw-shape-opt:hover { background: #dff0ff; }
.draw-shape-opt.active { border-color: #3498db; background: #dff0ff; box-shadow: 0 0 0 2px rgba(52,152,219,0.2); }
/* Workspace: layers left + viewport right */
#draw-workspace { display: flex; gap: 8px; width: 100%; max-width: 1100px; margin: 0 auto; align-items: flex-start; }
#draw-viewport { position: relative; overflow: hidden; border: 3px solid #ddd; border-radius: 12px; flex: 1; min-width: 0; background: #e8e8e8; touch-action: none; cursor: crosshair; }
#draw-canvas { display: block; position: absolute; left: 0; top: 0; background: #fff; }
#draw-layer-panel { display: flex; flex-direction: column; gap: 6px; width: 80px; flex-shrink: 0; }
#draw-layer-preview-strip { display: flex; flex-direction: column-reverse; gap: 6px; min-height: 60px; }
.draw-layer-preview-btn { width: 72px; margin: 0; padding: 5px; display: flex; flex-direction: column; align-items: center; gap: 3px; border-radius: 10px; background: #eef3f7; color: #2c3e50; border: 2px solid #d3dde6; cursor: grab; transition: border-color 0.15s, background 0.15s; }
.draw-layer-preview-btn:hover { background: #e6edf4; }
.draw-layer-preview-btn.active { border-color: #3498db; background: #dff0ff; box-shadow: 0 0 0 2px rgba(52,152,219,0.16); }
.draw-layer-preview-btn.clipped { margin-left: 10px; border-color: #9b59b6; border-style: dashed; }
.draw-layer-preview-btn.clipped.active { border-color: #8e44ad; background: #f3e5f5; box-shadow: 0 0 0 2px rgba(142,68,173,0.16); }
.draw-layer-clip-icon { font-size: 11px; color: #9b59b6; font-weight: bold; line-height: 1; margin-top: -2px; }
.draw-layer-preview-btn.group-header { background: #d5dde5; border-color: #b0bec5; }
.draw-layer-preview-btn.group-header.active { background: #c5d8eb; border-color: #3498db; }
.draw-layer-preview-btn.group-child { width: 64px; margin-left: 8px; padding: 3px; }
.draw-layer-preview-btn.group-child .draw-layer-preview-thumb { width: 52px; height: 34px; }
.draw-layer-preview-btn.drag-over { border-color: #e67e22; background: rgba(243,156,18,0.15); box-shadow: inset 0 0 0 2px rgba(230,126,34,0.25); }
.draw-layer-preview-btn.drag-over-top { border-top: 3px solid #3498db; background: transparent; }
.draw-layer-preview-btn.drag-over-bottom { border-bottom: 3px solid #3498db; background: transparent; }
.draw-layer-preview-btn.dragging { opacity: 0.4; }
.draw-layer-preview-thumb { width: 60px; height: 40px; border-radius: 6px; border: 1px solid #c8d5e1; background-color: #fff; background-position: center; background-repeat: no-repeat; background-size: contain; }
.draw-layer-preview-label { font-size: 0.62rem; font-weight: 800; line-height: 1; text-align: center; max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#draw-layer-actions { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.layer-action-btn { width: auto; min-width: 0; margin: 0; padding: 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; background: #34495e; border-radius: 8px; font-size: 0; cursor: pointer; border: none; color: #fff; }
.layer-action-btn svg { display: block; }
.layer-action-btn span { font-size: 0.54rem; font-weight: 700; line-height: 1; text-transform: uppercase; letter-spacing: 0.2px; }
.layer-action-btn.clip-active { background: #8e44ad; box-shadow: 0 0 0 2px rgba(142,68,173,0.3); }
#draw-submit-btn { }
/* Submitted strip */
#draw-submitted-strip { display: none; width: 100%; max-width: 760px; margin: 14px auto 0 auto; text-align: center; align-items: center; flex-direction: column; gap: 10px; }
#draw-thumb-btn { width: auto; margin: 0 auto; display: inline-flex; gap: 10px; align-items: center; background: #ecf0f1; color: #2c3e50; border: 2px solid #d0d5d8; padding: 8px 10px; border-radius: 12px; font-weight: 700; cursor: pointer; }
#draw-thumb-btn:hover { background: #e2e8ea; transform: none; }
#draw-thumb-image { width: 56px; height: 56px; object-fit: contain; border: 2px solid #cfd8dc; background: #fff; border-radius: 10px; }
#draw-waiting-msg { font-size: 1.08rem; font-weight: 800; color: #2c3e50; line-height: 1.3; }
.draw-result-badge { display:inline-block; padding: 8px 14px; border-radius: 12px; font-weight: 900; font-size: 1.05rem; }
.draw-result-badge.correct { background: rgba(46, 204, 113, 0.2); color: #1e874b; border: 2px solid rgba(46, 204, 113, 0.45); }
.draw-result-badge.wrong { background: rgba(231, 76, 60, 0.18); color: #b52f24; border: 2px solid rgba(231, 76, 60, 0.38); }
.draw-round-points { margin-top: 10px; font-weight: 800; font-size: 1rem; color: #2c3e50; }
.draw-round-loading { margin-top: 8px; font-weight: 800; font-size: 0.95rem; color: #5a6d85; }
#guess-phase-box { display: none; width: 100%; max-width: 760px; margin: 12px auto 0 auto; }
#guess-phase-box h3 { margin: 8px 0 10px 0; font-size: 1.9rem; text-align: center; }
#guess-image { width: 100%; max-width: 760px; max-height: 48vh; object-fit: contain; background: #fff; border: 3px solid #ddd; border-radius: 12px; }
#guess-input-row { display: flex; gap: 10px; margin-top: 10px; align-items: center; }
#draw-preview-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: none; align-items: center; justify-content: center; z-index: 2000; padding: 20px; }
#draw-preview-modal.show { display: flex; }
#draw-preview-content { background: #fff; border-radius: 14px; padding: 14px; max-width: min(92vw, 860px); max-height: 92vh; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
#draw-preview-image { width: 100%; max-height: 75vh; object-fit: contain; border: 3px solid #ddd; border-radius: 10px; background: #fff; }
#draw-preview-close { width: auto; margin: 0; padding: 8px 14px; }
/* --- Focus (fullscreen) drawing mode --- */
#draw-focus-toolbar {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  z-index: 10001; display: none; align-items: center; gap: 8px;
  background: rgba(30,30,30,0.92); backdrop-filter: blur(8px);
  padding: 8px 14px; border-radius: 28px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
#draw-focus-toolbar input[type="color"] { width: 32px; height: 32px; border: 2px solid #555; border-radius: 50%; padding: 0; cursor: pointer; background: none; }
#draw-focus-toolbar input[type="range"] { height: 4px; accent-color: #e17055; }
.focus-tool {
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.12); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
  transition: background 0.15s;
}
.focus-tool:active, .focus-tool.active { background: rgba(255,255,255,0.32); }
.focus-tool svg { stroke: #fff; }

.draw-focus-active { position: fixed !important; inset: 0 !important; z-index: 10000 !important; margin: 0 !important; padding: 0 !important; max-width: none !important; border-radius: 0 !important; background: #1a1a1a !important; overflow: hidden !important; }
.draw-focus-active #draw-target-row,
.draw-focus-active #draw-controls,
.draw-focus-active #draw-layer-panel,
.draw-focus-active #draw-submit-btn,
.draw-focus-active #drawduel-feedback,
.draw-focus-active #draw-submitted-strip { display: none !important; }
.draw-focus-active #draw-workspace { max-width: none !important; height: 100% !important; }
.draw-focus-active #draw-viewport { min-height: 0 !important; height: 100% !important; border: none !important; border-radius: 0 !important; background: #222 !important; }
.draw-focus-active #draw-focus-toolbar { display: flex !important; }

@media(max-width: 768px) {
  body { padding: 12px; }
  .site-logo { max-width: 92vw; }
  .brought-to-you { font-size: 0.7rem; }
  .social-link { width: 32px; height: 32px; }
  .social-link svg { width: 16px; height: 16px; }
  .social-bar { gap: 8px; margin-bottom: 10px; }
  .sound-toggle-btn { right: 12px; bottom: 12px; padding: 9px 12px; font-size: 0.82rem; }
  .mode-icon-dex, .mode-icon-draw { width: 84px; height: 84px; }
  .mode-icon-dex .mode-dex-device.back { width: 52px; height: 52px; }
  .mode-icon-dex .mode-dex-device.front { width: 68px; height: 68px; bottom: 12px; }
  .mode-dex-badge, .mode-draw-badge { font-size: 0.56rem; padding: 4px 7px; }
  .arena { flex-direction: row; height: auto; min-height: auto; gap: 8px; align-items: center; }
  .pokemon-card { min-height: auto; max-height: none; height: auto; padding: 10px 6px 34px; flex: 1 1 0; justify-content: center; }
  .pokemon-card img { max-height: 100px; max-width: 85%; }
  .card-hp-shell { left: 10px; right: 10px; bottom: 10px; height: 10px; }
  .prediction-results { gap: 12px; }
  .prediction-round { grid-template-columns:1fr; padding:10px; gap:10px; }
  .prediction-round-head { min-width:0; justify-content:center; }
  .prediction-panel { gap:8px; padding:10px; }
  .prediction-card-row { grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); gap:6px; }
  .prediction-arrow { transform:none; font-size:1rem; }
  .prediction-pokemon { gap:5px; padding:8px 6px; }
  .prediction-pokemon img, .prediction-empty-thumb { width:56px; height:56px; }
  .prediction-panel-title { font-size:0.8rem; }
  .prediction-label { font-size:0.6rem; letter-spacing:0.3px; }
  .prediction-name { font-size:0.74rem; }
  .prediction-result-badge { padding:6px 10px; font-size:0.72rem; }
  .dex-results-sections { gap: 14px; }
  .dex-results-grid { gap: 10px; }
  .dex-result-card { padding: 14px 12px 12px; gap: 8px; }
  .dex-result-question { padding: 12px 10px; font-size: 0.9rem; line-height: 1.45; }
  .dex-result-answer-block img { width: 72px; height: 72px; }
  .dex-result-answer-name { font-size: 0.92rem; }
  .dex-result-guess, .dex-result-source { font-size: 0.78rem; }
  .pokemon-name { font-size: 0.78rem; margin-top: 6px; letter-spacing: 1px; }
  .vs-badge { font-size: 1.1rem; padding: 6px; align-self: center; }
  .stats-grid { flex-direction: column; gap: 20px; }
  .stat-box { border-right: none; border-bottom: 2px solid rgba(255,255,255,0.2); padding-bottom: 10px; }
  .stat-box:last-child { border-bottom: none; }
  #result-screen { width: 100%; }
  .result-wrapper { padding: 0; }
  .result-topbar { margin-bottom: 12px; }
  .result-topbar .prompt-title { font-size: 1.15rem; }
  .result-topbar .prompt-subtitle { font-size: 0.76rem; }
  #summary-card { padding: 18px 14px 16px; margin: 0 auto 18px; border-radius: 18px; }
  #summary-card h2 { font-size: 1.9rem; }
  .trainer-tag { font-size: 1rem; margin-bottom: 18px; }
  .multiplayer-results { margin-bottom: 18px; padding: 14px 12px; }
  #card-images { padding: 14px 10px; gap: 12px; border-radius: 14px; }
  #leaderboard-box { padding: 14px 12px; }
  .btn-group { width: 100%; max-width: 100%; gap: 10px; flex-direction: column; }
  .btn-group button { margin: 0; }
  #drawduel-screen .box-panel { padding: 14px; }
  .prompt-banner { grid-template-columns: 1fr; padding: 8px 10px; }
  .prompt-center { order:1; width:100%; }
  .prompt-trainer-name { font-size: 1.15rem; }
  .prompt-game-name { font-size: 1rem; }
  .prompt-subtitle { font-size: 0.78rem; }
  .drawduel-timer-line { font-size: 1.02rem; padding: 6px 12px; margin-top: 5px; }
  .topbar-actions.left { order:2; justify-content:center; }
  .topbar-actions.right { order:3; justify-content:center; }
  .topbar-btn { padding: 8px 10px; font-size: 0.78rem; }
  .topbar-code-chip { font-size: 0.82rem; padding: 8px 11px; }
  .battle-phase-indicator { min-height:48px; padding:10px 14px; font-size:0.95rem; margin-bottom:10px; }
  .battle-phase-indicator .phase-icon { font-size:1.3rem; }
  .battle-phase-flash { font-size:clamp(1.2rem, 3vw, 1.6rem); }
  .battle-phase-flash .flash-inner { padding:22px 24px; border-radius:18px; }
  .battle-phase-flash .flash-icon { font-size:2.5rem; }
  .wtp-scoreboard { padding: 12px; }
  .wtp-board-head { font-size: 0.92rem; }
  .wtp-score-line { grid-template-columns:minmax(120px,1.3fr) auto minmax(88px,1fr); gap:8px; padding:8px 9px; }
  .wtp-line-score { font-size: 1.7rem; }
  .wtp-line-streak { font-size: 0.74rem; }
  .dex-entry-card { min-height: 220px; padding: 18px 16px 16px; }
  .dex-entry-text { font-size: 0.98rem; line-height: 1.6; }
  .dex-entry-version { font-size: 0.74rem; }
  #draw-target-row { gap: 8px; margin-bottom: 4px; }
  #draw-target-image { width: 56px !important; height: 56px !important; }
  #draw-target { font-size: 1rem !important; }
  #draw-workspace { flex-direction: column-reverse; gap: 4px; }
  #draw-layer-panel { width: 100%; flex-direction: row; gap: 4px; align-items: flex-start; }
  #draw-layer-preview-strip { flex-direction: row-reverse; gap: 6px; flex: 1; overflow-x: auto; min-height: auto; }
  .draw-layer-preview-btn { width: 60px; min-width: 60px; }
  .draw-layer-preview-thumb { width: 50px; height: 32px; }
  #draw-layer-actions { flex-direction: row; }
  #draw-viewport { min-height: 54vh; }
  #draw-controls { gap: 4px !important; margin-bottom: 4px !important; }
  #draw-action-row .tool-btn { min-width: 40px; height: 40px; padding: 3px 2px; gap: 1px; flex-direction: column; }
  #draw-action-row .tool-label { font-size: 0.5rem; }
  #draw-action-row .tool-icon, #draw-action-row .tool-icon svg { width: 14px; height: 14px; }
  #draw-action-row { gap: 4px; }
  #draw-tool-bar { gap: 5px !important; }
  .draw-setting-label { font-size: 0.6rem; }
  #draw-tool-bar input[type="range"] { width: 60px !important; }
  #draw-rotate-left-btn, #draw-rotate-right-btn, #draw-rotation-level { display: none !important; }
  .draw-popup { min-width: 200px; left: 0; transform: none; }
  #brush-preview { width: 28px; height: 28px; }
  #draw-color { width: 28px; height: 28px; }
  #draw-submit-btn { width: 100% !important; max-width: 280px; }
  #draw-thumb-btn { width: 100%; justify-content: center; font-size: 0.9rem; }
  #draw-thumb-image { width: 48px; height: 48px; }
  #draw-waiting-msg { font-size: 1.02rem; }
  #guess-phase-box { margin-top: 8px; }
  #guess-phase-box h3 { font-size: 1.45rem; margin-bottom: 8px; }
  #guess-image { max-height: 34vh; }
  #guess-input-row { gap: 8px; margin-top: 8px; }
  #guess-input-row input { margin: 0; }
  #guess-submit-btn { width: auto; margin: 0; white-space: nowrap; padding: 12px 14px; }
}

/* Global leaderboard period buttons */
.lb-period-btn { width:auto; margin:0; padding:6px 14px; font-size:0.82rem; font-weight:700; border-radius:20px; background:#eef2f6; color:var(--text); border:2px solid #d7dbe0; cursor:pointer; transition:all .2s; }
.lb-period-btn.active { background:var(--secondary); color:#fff; border-color:var(--secondary); }
.lb-period-btn:hover { background:var(--secondary); color:#fff; border-color:var(--secondary); transform:none; }
.lb-entry { display:flex; align-items:center; gap:10px; padding:6px 8px; border-radius:8px; transition:background .15s; }
.lb-entry:nth-child(odd) { background:rgba(0,0,0,.02); }
.lb-entry:hover { background:rgba(52,152,219,.06); }
.lb-rank { font-weight:900; font-size:0.9rem; min-width:28px; color:var(--muted, #95a5a6); }
.lb-rank.gold { color:#f1c40f; }
.lb-rank.silver { color:#95a5a6; }
.lb-rank.bronze { color:#cd7f32; }
.lb-sprite { width:36px; height:36px; object-fit:contain; }
.lb-name { font-weight:700; font-size:0.9rem; flex:1; }
.lb-count { font-weight:800; font-size:0.95rem; color:var(--primary); }

/* Large desktop — use the space */
@media (min-width: 1024px) {
  body { padding: 20px 40px; }
  .site-header { margin-bottom: 10px; }
  .site-logo { max-width: 700px; }
  .box-panel { max-width: 860px; padding: 44px 52px; }
  #setup-screen .box-panel { max-width: 860px; }
  .prompt-banner { border-radius: 16px; padding: 14px 24px; }
  #game-mode-cards { grid-template-columns: repeat(4, 1fr) !important; gap: 14px !important; }
  .screen { max-width: 1400px; }
  .arena { gap: 30px; }
  .pokemon-card { max-width: 380px; }
  #summary-card { max-width: 900px; }
  #wtp-screen .box-panel { max-width: 900px; }
  #drawduel-screen .box-panel { max-width: 1080px; }
  #draw-viewport { min-height: 520px; }
  /* Option buttons fill more space */
  .option-btn-group { justify-content: flex-start; }
  .option-btn-group .opt-btn { min-width: 80px; }
  .binary-toggle button { flex: 0 1 200px; }
  /* Trainer name section wider */
  #trainer-name-section { max-width: 500px; margin-left: auto; margin-right: auto; }
}

@media (min-width: 1440px) {
  .box-panel { max-width: 960px; }
  .screen { max-width: 1600px; }
  #setup-screen .box-panel { max-width: 960px; }
}

/* === END OF FILE (FILENAME: styles.css) === */
