html { background: #041a33; }
:root { --sea1: #06223f; --sea2: #0b3d6e; --gold: #ffd43b; }
html, body { min-height: 100%; }
body { background: radial-gradient(1200px 600px at 70% -10%, #13579a 0%, transparent 60%), linear-gradient(180deg, #0a3360 0%, #041a33 100%) #041a33; color: #e9f2ff; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
a { color: #7cc4ff; }
.sea-nav { background: rgba(3, 20, 40, .92); backdrop-filter: blur(6px); border-bottom: 1px solid rgba(255,255,255,.08); padding-top: max(.5rem, env(safe-area-inset-top)); }
.brand-fish { display: inline-block; animation: swim 3s ease-in-out infinite; }
@keyframes swim { 50% { transform: translateX(4px) rotate(-6deg); } }
.coin-chip, .shell-chip { display: inline-flex; align-items: center; gap: 4px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,212,59,.4); color: var(--gold); border-radius: 999px; padding: 2px 10px; font-weight: 700; font-size: .9rem; }
.shell-chip { color: #9be7ff; border-color: rgba(155,231,255,.4); }
.ico-coin::before { content: "🪙"; font-style: normal; } .ico-shell::before { content: "🐚"; font-style: normal; }
.ann-bar { background: rgba(255, 193, 7, .1); border-bottom: 1px solid rgba(255,193,7,.25); padding: 6px 0; font-size: .9rem; overflow: hidden; }
.ann-scroll { overflow: hidden; white-space: nowrap; flex: 1; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ann-track { display: inline-block; padding-left: 100%; animation: marquee 28s linear infinite; }
.ann-track span { margin-right: 4em; }
@keyframes marquee { to { transform: translateX(-100%); } }
.sea-card, .card.sea-card { background: rgba(6, 30, 58, .85); border: 1px solid rgba(124,196,255,.2); color: #e9f2ff; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.sea-card .form-control, .sea-card .form-select { background: rgba(255,255,255,.95); }
.site-footer { background: rgba(0,0,0,.35); padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); text-align: center; margin-top: auto; }
.site-footer .notice { color: #ffd43b; font-weight: 700; }
.table { --bs-table-bg: transparent; --bs-table-color: #e9f2ff; --bs-table-striped-color: #e9f2ff; --bs-table-hover-color: #fff; --bs-table-border-color: rgba(255,255,255,.12); }
.text-muted { color: #9fb6d1 !important; }

/* ---------- 大厅 ---------- */
.lobby { display: grid; grid-template-columns: 220px 1fr; gap: 16px; }
.room-tabs { display: flex; flex-direction: column; gap: 10px; }
.room-tab { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; text-decoration: none; color: #fff; background: rgba(255,255,255,.06); border: 2px solid transparent; transition: .15s; }
.room-tab:hover { background: rgba(255,255,255,.12); color: #fff; }
.room-tab.active { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255,212,59,.15); }
.room-tab.theme-blue { background-image: linear-gradient(135deg, rgba(11,94,156,.8), rgba(6,58,107,.6)); }
.room-tab.theme-teal { background-image: linear-gradient(135deg, rgba(12,138,138,.8), rgba(6,90,107,.6)); }
.room-tab.theme-purple { background-image: linear-gradient(135deg, rgba(75,60,158,.85), rgba(42,36,112,.6)); }
.room-tab.theme-red { background-image: linear-gradient(135deg, rgba(158,60,75,.9), rgba(94,31,58,.6)); }
.room-ico { font-size: 1.8rem; line-height: 1; }
.room-txt { display: flex; flex-direction: column; } .room-txt small { opacity: .75; font-size: .75rem; }
.side-card { margin-top: 14px; padding: 14px; border-radius: 14px; background: rgba(0,0,0,.25); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.legend .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; background: rgba(255,255,255,.2); border: 1px dashed rgba(255,255,255,.5); }
.dot.me { background: #ffc107; border: 0; } .dot.human { background: #20c997; border: 0; } .dot.ai { background: #6c757d; border: 0; }
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gtable { background: radial-gradient(ellipse at center, rgba(28,120,190,.55), rgba(6,40,80,.7)); border: 1px solid rgba(124,196,255,.25); border-radius: 14px; padding: 8px; }
.gtable.full { opacity: .7; } .gtable.mine { border-color: var(--gold); box-shadow: 0 0 12px rgba(255,212,59,.35); }
.gt-head { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: 4px; }
.gt-head .occ { color: #9fe; font-weight: 700; }
.gt-seats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seat { height: 34px; border-radius: 9px; border: 1px dashed rgba(255,255,255,.45); background: rgba(255,255,255,.08); color: #fff; font-size: .75rem; font-weight: 700; padding: 0; overflow: hidden; white-space: nowrap; }
.seat.empty:hover { background: rgba(255,212,59,.3); border-color: var(--gold); }
.seat.human { background: #20c997; border: 0; } .seat.ai { background: #6c757d; border: 0; } .seat.me { background: #ffc107; color: #222; border: 0; }
.seat[disabled] { opacity: 1; }
.gt-pool { margin: 6px 0; text-align: center; font-size: .78rem; padding: 6px 0; border-radius: 8px; background: rgba(0,0,0,.2); cursor: pointer; user-select: none; }
.gt-pool:hover { background: rgba(255,212,59,.25); }
@media (max-width: 991.98px) {
  .lobby { grid-template-columns: 1fr; gap: 10px; }
  .room-side { position: sticky; top: 56px; z-index: 5; padding: 6px 0; background: rgba(4,26,51,.95); }
  .room-tabs { flex-direction: row; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; scrollbar-width: none; }
  .room-tabs::-webkit-scrollbar { display: none; }
  .room-tab { flex: 0 0 auto; padding: 8px 12px; scroll-snap-align: start; min-height: 48px; }
  .room-ico { font-size: 1.3rem; }
}
@media (max-width: 575.98px) {
  .table-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .seat { height: 38px; }
  .room-head h5 { font-size: 1rem; }
}

/* ---------- 大鱼弹幕 ---------- */
#bigfish-layer { position: fixed; left: 0; right: 0; top: calc(12% + env(safe-area-inset-top)); height: 0; z-index: 2500; pointer-events: none; }
.danmaku { position: absolute; left: 100%; white-space: nowrap; padding: 10px 22px; border-radius: 999px; font-size: clamp(15px, 2.6vw, 26px); font-weight: 800; animation: danmaku 9s linear 1 forwards; box-shadow: 0 6px 24px rgba(0,0,0,.4); }
.danmaku.big { background: linear-gradient(90deg, #b8001f, #ff7a00, #ffd400); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.35); border: 2px solid #fff3a0; }
.danmaku.big .win, .danmaku.big .fishname { color: #fff7b0; } 
.danmaku.ann { top: 60px; background: rgba(13,110,253,.92); color: #fff; animation-duration: 12s; }
.ai-tag { background: #495057; color: #fff; border-radius: 6px; font-size: .7em; padding: 1px 6px; margin-right: 4px; vertical-align: 2px; }
@keyframes danmaku { from { transform: translateX(0); } to { transform: translateX(calc(-100vw - 100%)); } }

/* ---------- 游戏桌 ---------- */
.game-body { overflow: hidden; position: fixed; inset: 0; overscroll-behavior: none; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; background: #020f1f; }
.game-wrap { position: fixed; inset: 0; display: flex; flex-direction: column; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.stage { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
#cv { display: block; touch-action: none; border-radius: 6px; box-shadow: 0 0 0 2px rgba(124,196,255,.25), 0 10px 40px rgba(0,0,0,.6); cursor: crosshair; }
.footer-mini { text-align: center; font-size: 11px; color: #ffd43b; opacity: .85; line-height: 16px; height: 16px; white-space: nowrap; overflow: hidden; }
.hbtn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 40px; padding: 4px 10px; border-radius: 12px; border: 1px solid rgba(255,255,255,.35); background: rgba(3,25,50,.75); color: #fff; font-weight: 700; text-decoration: none; font-size: 14px; touch-action: manipulation; }
.hbtn:active { transform: scale(.94); } .hbtn:hover { color: #fff; background: rgba(20,60,100,.9); }
.hbtn.big { min-width: 56px; min-height: 52px; font-size: 18px; }
.hbtn.toggle { font-size: 14px; } .hbtn.toggle.on { background: #ffc107; color: #222; border-color: #fff; }
.bet-box { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 64px; min-height: 52px; border-radius: 12px; background: rgba(0,0,0,.5); border: 1px solid rgba(255,212,59,.5); color: var(--gold); line-height: 1.1; }
.bet-box small { font-size: 11px; color: #ddd; } .bet-box b { font-size: 18px; }
.hud-title { color: #fff; font-weight: 700; font-size: 14px; white-space: nowrap; }
.hud-coin { display: inline-flex; gap: 4px; align-items: center; background: rgba(0,0,0,.55); color: var(--gold); padding: 6px 10px; border-radius: 12px; font-size: 15px; border: 1px solid rgba(255,212,59,.4); white-space: nowrap; }
.hud-top, .hud-bottom { position: absolute; display: flex; gap: 8px; align-items: center; z-index: 5; }
/* 竖屏：上方信息栏 + 下方大按钮 */
.mode-bottom .hud-top { top: 6px; left: 8px; right: 8px; flex-wrap: nowrap; }
.mode-bottom .hud-top .hud-title { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.mode-bottom .hud-bottom { bottom: 8px; left: 6px; right: 6px; justify-content: center; flex-wrap: wrap; }
/* 横屏：两侧竖排按钮，不遮挡画面 */
.mode-side .hud-top { left: 6px; top: 6px; bottom: 6px; width: calc((100% - var(--cw)) / 2 - 12px); max-width: 80px; flex-direction: column; justify-content: flex-start; }
.mode-side .hud-bottom { right: 6px; top: 6px; bottom: 6px; width: calc((100% - var(--cw)) / 2 - 12px); max-width: 80px; flex-direction: column; justify-content: center; }
.mode-side .hud-top .hud-title { display: none; }
.mode-side .hud-top > *, .mode-side .hud-bottom > * { width: 100%; }
.mode-side .hud-coin { flex-direction: column; font-size: 12px; padding: 6px 2px; }
.mode-side #betUp { order: 1; } .mode-side .bet-box { order: 2; } .mode-side #betDown { order: 3; } .mode-side #btnAuto { order: 4; } .mode-side #btnLock { order: 5; }
@media (max-height: 430px) { .mode-side .hbtn.big { min-height: 46px; } .mode-side .bet-box { min-height: 46px; } .mode-side .hud-bottom { gap: 6px; } .hide-short { display: none !important; } }
.toast-msg { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%) scale(.9); background: rgba(0,0,0,.8); color: #fff; padding: 10px 18px; border-radius: 12px; opacity: 0; transition: .2s; pointer-events: none; z-index: 10; max-width: 80%; text-align: center; }
.toast-msg.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.rotate-hint { position: fixed; inset: 0; background: rgba(2,15,31,.94); z-index: 50; display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; }
.rotate-hint.show { display: flex; }
.rot-ico { font-size: 56px; animation: rot 2s ease-in-out infinite; } @keyframes rot { 50% { transform: rotate(90deg); } }

/* ---------- 图鉴 / 钱包 / 商城 ---------- */
.fish-card canvas { width: 100%; height: 110px; background: radial-gradient(ellipse, rgba(28,120,190,.6), rgba(6,40,80,.3)); border-radius: 10px; }
.big-badge { background: linear-gradient(90deg, #ff7a00, #ffd400); color: #3a1d00; }
.stat-num { font-size: 1.6rem; font-weight: 800; }
.skin-swatch { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 8px; border: 3px solid rgba(255,255,255,.6); }
.wallet-box { border-radius: 14px; padding: 14px; background: rgba(0,0,0,.25); height: 100%; }
@media (max-width: 575.98px) { .stat-num { font-size: 1.3rem; } main.container-xl { padding-left: 10px; padding-right: 10px; } .table-responsive-stack td { white-space: normal; } }

/* ---------- 后台 ---------- */
.admin-body .sea-nav { background: #111c2b; }
.admin-body main { max-width: 1400px; }
.thumb-fish { width: 64px; height: 44px; }
.lobby > * { min-width: 0; }
@media (max-width: 991.98px) { .lobby { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 575.98px) { .table-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .gtable { padding: 6px; } .gt-seats { gap: 4px; } }
.boss-warn { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 6; pointer-events: none; text-align: center; padding: 10px 34px; background: linear-gradient(90deg, rgba(160,0,20,0), rgba(200,10,30,.9) 20%, rgba(200,10,30,.9) 80%, rgba(160,0,20,0)); color: #fff; border-top: 2px solid #ffd43b; border-bottom: 2px solid #ffd43b; animation: bosswarn 2.6s ease forwards; white-space: nowrap; }
.boss-warn small { display: block; color: #ffd43b; letter-spacing: 6px; font-weight: 800; font-size: 12px; }
.boss-warn b { font-size: clamp(16px, 3vw, 30px); text-shadow: 0 2px 0 rgba(0,0,0,.4); }
@keyframes bosswarn { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.4); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }

/* 电脑玩家标识：始终可见的机器人图标，不可关闭 */
.ai-ico { display: inline-block; font-size: 14px; line-height: 1; vertical-align: middle; filter: drop-shadow(0 0 1px #000) drop-shadow(0 0 2px #ffd43b); cursor: help; }
.seat.ai { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; gap: 1px; background: #5c636a; }
.seat.ai .seat-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: .68rem; }
.seat.ai .ai-ico { font-size: 13px; filter: drop-shadow(0 0 1px #000) drop-shadow(0 1px 1px #fff8); }
.ai-tip { position: fixed; transform: translate(-50%,-100%); background: #212529; color: #fff; border-radius: 6px; padding: 3px 8px; font-size: 12px; pointer-events: none; opacity: 0; z-index: 9999; transition: opacity .15s; white-space: nowrap; box-shadow: 0 2px 8px #0008; }
.ai-tip.show { opacity: 1; }
.room-meta b { color: #ffd43b; }
.danmaku .ai-ico { font-size: 1.05em; margin-right: 2px; filter: drop-shadow(0 0 2px #fff); }
#carryModal .modal-content { background: #0c3056; }
.skin-swatch { width: 72px; height: 52px; border-radius: 10px; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }

/* v4: avatars, cannons HUD helpers, check-in, online chests, events */
.avatar-sm, .avatar-lg, .seat-av, .danmaku-av { border-radius: 50%; object-fit: cover; background: #1a2a40; }
.avatar-lg { border: 3px solid rgba(255,212,59,.7); }
.avatar-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.avatar-pick { border: 2px solid transparent; background: transparent; padding: 0; border-radius: 50%; cursor: pointer; }
.avatar-pick.on, .avatar-pick:hover { border-color: #ffd43b; }
.avatar-pick img { display:block; border-radius:50%; }
.seat { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 42px; }
.seat-av { width: 22px; height: 22px; border: 1.5px solid rgba(255,255,255,.45); }
.seat-av.fr-frame_gold { border-color: #ffd43b; box-shadow: 0 0 4px #ffd43b; }
.seat-av.fr-frame_wave { border-color: #4dabf7; box-shadow: 0 0 4px #4dabf7; }
.seat.me .seat-av, .seat.human .seat-av { margin-top: 1px; }
.danmaku-av { width: 1.3em; height: 1.3em; vertical-align: middle; margin-right: 4px; border: 1px solid #ffe066; }
.checkin-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
@media (max-width: 700px) { .checkin-cal { grid-template-columns: repeat(4, 1fr); } }
.checkin-cal .day { background: rgba(255,255,255,.08); border-radius: 12px; padding: 12px 8px; text-align: center; border: 2px solid transparent; }
.checkin-cal .day.done { background: rgba(32,201,151,.25); border-color: #20c997; }
.checkin-cal .day.next { background: rgba(255,212,59,.22); border-color: #ffd43b; animation: pulse 1.4s ease infinite; }
.checkin-cal .d-num { font-weight: 700; font-size: .85rem; }
.checkin-cal .d-gold { color: #ffd43b; font-weight: 800; margin-top: 4px; }
.checkin-cal .d-st { font-size: .7rem; margin-top: 4px; }
@keyframes pulse { 50% { box-shadow: 0 0 12px rgba(255,212,59,.6); } }
.online-box { position: absolute; left: 8px; bottom: 86px; z-index: 5; display: flex; flex-direction: column; gap: 4px; }
.mode-side .online-box { left: 10px; bottom: 12px; }
.och { background: rgba(8,20,40,.78); color: #fff; border: 1px solid rgba(255,212,59,.4); border-radius: 10px; padding: 4px 8px; font-size: 11px; text-align: left; }
.och.ready { background: linear-gradient(90deg,#c9a227,#ffd43b); color: #222; font-weight: 800; animation: pulse 1.2s ease infinite; cursor: pointer; }
.och.done { opacity: .5; }
.boss-warn.pirate { background: linear-gradient(90deg, rgba(20,0,40,0), rgba(90,20,120,.92) 20%, rgba(160,40,20,.92) 80%, rgba(20,0,40,0)); border-color: #ffe066; }
.event-banner { background: linear-gradient(90deg, #4c1d95, #b45309); color: #fff; padding: 8px 16px; border-radius: 10px; margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.event-banner a { color: #ffe066; }
.event-banner .cd { font-weight: 800; }
