/* ============================================================
   FISHING ISLANDS — UI Styles
   ============================================================ */
:root {
  --rarity-common: #9fb6c3;
  --rarity-uncommon: #4ade80;
  --rarity-rare: #60a5fa;
  --rarity-legendary: #fbbf24;
  --glass: rgba(10, 22, 34, 0.72);
  --glass-2: rgba(6, 16, 26, 0.85);
  --glass-border: rgba(140, 200, 255, 0.18);
  --accent: #38bdf8;
  --accent-2: #fbbf24;
  --text: #eaf4fb;
  --text-dim: #9db4c4;
  --danger: #f87171;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  width: 100%; height: 100%; overflow: hidden; background: #06202e;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text); touch-action: none; overscroll-behavior: none;
  user-select: none; -webkit-user-select: none;
}
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
.visible { display: flex; }
.icon-svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,.45)); }
.overlay { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px; }
body:not(.touch) .touch-only { display: none !important; }

/* ============ LOGIN ============ */
#loginScreen {
  background: radial-gradient(1200px 700px at 70% -10%, #155e75 0%, #0c3f57 40%, #06202e 100%);
  z-index: 100; flex-direction: column; overflow: hidden;
}
.login-bg-waves { position: absolute; inset: auto 0 0 0; height: 34vh; pointer-events: none; opacity: .5; }
.login-bg-waves span {
  position: absolute; bottom: -60px; left: -50%; width: 200%; height: 100%;
  background: radial-gradient(ellipse 55% 60% at 50% 100%, rgba(56,189,248,.35), transparent 70%);
  animation: waveMove 9s ease-in-out infinite;
}
.login-bg-waves span:nth-child(2) { animation-duration: 13s; animation-delay: -4s; opacity: .6; }
.login-bg-waves span:nth-child(3) { animation-duration: 17s; animation-delay: -8s; opacity: .4; }
@keyframes waveMove { 0%,100% { transform: translateX(-6%) scaleY(1);} 50% { transform: translateX(6%) scaleY(1.15);} }
.login-card {
  position: relative; z-index: 2; width: min(410px, 94vw);
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 20px;
  padding: 34px 30px 26px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 70px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.06); text-align: center;
}
.login-logo {
  width: 72px; height: 72px; margin: -72px auto 10px; display: flex; align-items: center; justify-content: center;
  color: var(--accent); background: linear-gradient(145deg, #0e3a52, #155e75);
  border: 1px solid var(--glass-border); border-radius: 50%; box-shadow: 0 10px 30px rgba(2,132,199,.35);
}
.login-logo svg { width: 42px; height: 42px; }
#loginScreen h1 {
  font-size: 30px; letter-spacing: 1px;
  background: linear-gradient(90deg, #7dd3fc, #38bdf8, #2dd4bf);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.login-sub { color: var(--text-dim); font-size: 12.5px; margin: 6px 0 20px; }
#loginForm input {
  width: 100%; padding: 13px 16px; margin-bottom: 10px; background: rgba(2, 20, 30, .6);
  border: 1px solid var(--glass-border); border-radius: 12px; color: var(--text); font-size: 15px;
  outline: none; transition: border .15s, box-shadow .15s;
}
#loginForm input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(56,189,248,.18); }
.login-btns { display: flex; gap: 10px; margin-top: 4px; }
.login-btns .btn { flex: 1; }
.login-error { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 9px; }
.login-status { color: var(--text-dim); font-size: 12px; min-height: 16px; }
.login-hints { display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: center; margin-top: 16px; font-size: 11px; color: var(--text-dim); }
.login-hints b { color: var(--accent); }

/* ============ BUTTONS ============ */
.btn { padding: 12px 16px; border: none; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--text); font-family: inherit; transition: transform .1s, filter .15s; }
.btn:active { transform: scale(.96); }
.btn-primary { background: linear-gradient(135deg, #0ea5e9, #0284c7); box-shadow: 0 6px 18px rgba(2,132,199,.35); }
.btn-primary:hover { filter: brightness(1.12); }
.btn-ghost { background: rgba(148, 197, 230, .12); border: 1px solid var(--glass-border); }
.btn-ghost:hover { background: rgba(148,197,230,.2); }
.btn-warn { background: linear-gradient(135deg, #f59e0b, #b45309); }
.btn-gold { background: linear-gradient(135deg, #fbbf24, #d97706); color: #231a04; box-shadow: 0 6px 18px rgba(217,119,6,.35); }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: grayscale(.5); }

/* ============ HUD ============ */
#hud { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
#crosshair { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 22px; height: 22px; }
#crosshair::before, #crosshair::after {
  content: ''; position: absolute; background: rgba(255,255,255,.75); box-shadow: 0 0 4px rgba(0,0,0,.9);
}
#crosshair::before { left: 50%; top: 0; width: 2px; height: 100%; transform: translateX(-50%); }
#crosshair::after { top: 50%; left: 0; height: 2px; width: 100%; transform: translateY(-50%); }
#crosshair span { position: absolute; inset: 8px; border-radius: 50%; background: rgba(56,189,248,.9); }
#hudTop { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hud-chip {
  pointer-events: auto; display: flex; align-items: center; gap: 7px;
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 999px; padding: 8px 14px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-weight: 700; font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.35);
}
.hud-chip svg { width: 18px; height: 18px; color: var(--accent-2); }
#chipOnline svg { color: #4ade80; }
#chipPing { font-size: 11px; color: var(--text-dim); font-weight: 600; }
#chipPing.ws { color: #4ade80; }
#chipPing.poll { color: var(--accent-2); }
.hud-btn { cursor: pointer; color: var(--text); }
.hud-btn svg { color: var(--accent); }
.hud-btn:hover { background: rgba(30, 60, 85, .8); }
#hudName {
  position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px;
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 999px;
  padding: 8px 16px; font-size: 13px; font-weight: 600; color: var(--text-dim);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}

/* kartu item di tangan (kiri) */
#heldCard {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 10px; width: 190px;
  background: var(--glass); border: 1px solid var(--glass-border); border-left: 3px solid var(--accent);
  border-radius: 14px; padding: 10px 12px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 32px rgba(0,0,0,.42); animation: heldIn .2s ease-out;
}
@keyframes heldIn { from { opacity: 0; transform: translate(-14px,-50%);} to { opacity: 1; transform: translate(0,-50%);} }
#heldIcon { width: 46px; height: 46px; flex-shrink: 0; }
#heldInfo { min-width: 0; }
#heldInfo b { display: block; font-size: 13px; line-height: 1.25; }
#heldInfo span { display: block; font-size: 10.5px; color: var(--text-dim); margin-top: 3px; line-height: 1.3; }

#prompt {
  position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%);
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 12px;
  padding: 10px 18px; font-size: 14px; font-weight: 600; text-align: center; max-width: 88vw;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 6px 24px rgba(0,0,0,.4);
  animation: promptIn .18s ease-out;
}
#prompt b { color: var(--accent); }
@keyframes promptIn { from { opacity: 0; transform: translate(-50%, 8px);} to { opacity: 1; transform: translate(-50%, 0);} }
#lockHint { position: absolute; left: 50%; bottom: 14%; transform: translateX(-50%); color: var(--text-dim); font-size: 13px; text-shadow: 0 1px 4px #000; }

/* ============ HOTBAR ============ */
#hotbar {
  position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%); display: flex; gap: 8px; pointer-events: auto;
}
.hot-slot {
  position: relative; width: 60px; height: 60px; border-radius: 14px; cursor: pointer;
  background: var(--glass); border: 2px solid rgba(140,200,255,.16);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(0,0,0,.42);
  display: flex; align-items: center; justify-content: center; padding: 9px;
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.hot-slot:active { transform: scale(.93); }
.hot-slot.active {
  border-color: var(--accent); transform: translateY(-7px) scale(1.06);
  box-shadow: 0 0 0 3px rgba(56,189,248,.24), 0 10px 26px rgba(0,0,0,.5);
}
.hot-key { position: absolute; left: 5px; top: 3px; font-size: 10px; font-weight: 800; color: var(--text-dim); }
.hot-qty { position: absolute; right: 5px; bottom: 3px; font-size: 11px; font-weight: 800; text-shadow: 0 1px 3px #000; }
.hot-rarity { position: absolute; right: 5px; top: 5px; width: 7px; height: 7px; border-radius: 50%; }

/* ============ ACTION BUTTONS / JOYSTICK ============ */
#deskButtons { position: absolute; right: 14px; bottom: max(84px, calc(env(safe-area-inset-bottom) + 84px)); display: flex; flex-direction: column; gap: 9px; pointer-events: auto; }
.action-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 72px; padding: 10px 12px;
  background: var(--glass); color: var(--text); border: 1px solid var(--glass-border); border-radius: 16px;
  cursor: pointer; font-family: inherit; font-size: 11px; font-weight: 700;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(0,0,0,.4); transition: transform .1s, background .15s;
}
.action-btn svg { width: 22px; height: 22px; color: var(--accent); }
.action-btn:hover { background: rgba(30, 60, 85, .85); }
.action-btn:active { transform: scale(.93); }
.action-btn.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(56,189,248,.25), 0 6px 20px rgba(0,0,0,.4); }
#btnBoat.on svg { color: #4ade80; }
#joystick {
  display: none; position: absolute; left: 22px; bottom: max(90px, calc(env(safe-area-inset-bottom) + 90px));
  width: 124px; height: 124px; border-radius: 50%;
  background: rgba(10,22,34,.4); border: 2px solid rgba(140,200,255,.24);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: auto;
}
#joystickKnob {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 52px; height: 52px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(125,211,252,.95), rgba(2,132,199,.9)); box-shadow: 0 4px 14px rgba(0,0,0,.5);
}
body.touch #joystick { display: block; }

/* ============ CHAT ============ */
#chatWrap { position: absolute; left: 12px; bottom: max(14px, env(safe-area-inset-bottom)); width: min(340px, 60vw); pointer-events: none; z-index: 30; }
body.touch #chatWrap { bottom: max(224px, calc(env(safe-area-inset-bottom) + 224px)); width: min(280px, 62vw); }
#chatLog { display: flex; flex-direction: column; gap: 4px; max-height: 28vh; overflow: hidden; margin-bottom: 8px; }
.chat-line {
  background: rgba(6,20,30,.62); border-radius: 10px; padding: 6px 10px; font-size: 12.5px; line-height: 1.35;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: chatIn .2s ease-out; word-break: break-word; border-left: 3px solid var(--accent);
}
.chat-line.system { border-left-color: var(--accent-2); color: var(--accent-2); font-style: italic; }
.chat-line b { font-weight: 800; margin-right: 5px; }
.chat-line.fade { opacity: 0; transition: opacity .6s; }
@keyframes chatIn { from { opacity: 0; transform: translateX(-14px);} to { opacity: 1; transform: none;} }
#chatForm { pointer-events: auto; }
#chatInput {
  width: 100%; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; font-family: inherit;
  background: var(--glass-2); border: 1px solid var(--accent); color: var(--text); outline: none;
  box-shadow: 0 0 0 3px rgba(56,189,248,.16);
}
#btnChat {
  pointer-events: auto; width: 42px; height: 42px; border-radius: 12px; cursor: pointer;
  background: var(--glass); border: 1px solid var(--glass-border); color: var(--accent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 6px 20px rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
}
#btnChat svg { width: 21px; height: 21px; }
#btnChat:active { transform: scale(.93); }

/* ============ PANEL ============ */
#inventoryPanel, #shopPanel { background: rgba(2,10,16,.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 50; }
.panel {
  width: min(440px, 95vw); max-height: 86vh; overflow-y: auto;
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 18px; padding: 18px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 24px 70px rgba(0,0,0,.55); animation: panelIn .22s cubic-bezier(.2,1.4,.4,1);
}
@keyframes panelIn { from { opacity: 0; transform: translateY(16px) scale(.97);} to { opacity: 1; transform: none;} }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; gap: 10px; }
.panel-head h2 { font-size: 19px; }
.panel-sub { font-size: 12px; color: var(--text-dim); font-weight: 500; }
.panel-close { background: rgba(148,197,230,.12); color: var(--text); border: none; width: 32px; height: 32px; border-radius: 10px; cursor: pointer; font-size: 14px; flex-shrink: 0; }
.panel-close:hover { background: rgba(148,197,230,.25); }
.panel-hint { font-size: 11.5px; color: var(--text-dim); margin-top: 10px; text-align: center; }
.panel-hint b { color: var(--accent); }

.inv-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.inv-slot {
  aspect-ratio: 1; border-radius: 12px; position: relative; cursor: pointer; padding: 8px;
  background: rgba(2,20,30,.55); border: 1px solid rgba(140,200,255,.12);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .12s, transform .1s;
}
.inv-slot:hover { border-color: var(--accent); }
.inv-slot:active { transform: scale(.94); }
.inv-slot.empty { cursor: default; opacity: .4; }
.inv-slot.selected { border-color: var(--accent-2); box-shadow: 0 0 0 2px rgba(251,191,36,.35); }
.inv-slot.hotbar::after {
  content: attr(data-key); position: absolute; left: 4px; top: 2px; font-size: 9.5px; font-weight: 800; color: var(--accent);
}
.inv-qty { position: absolute; right: 4px; bottom: 3px; font-size: 11px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px #000; }
.inv-rarity { position: absolute; right: 5px; top: 5px; width: 7px; height: 7px; border-radius: 50%; }
.rarity-common { background: var(--rarity-common); }
.rarity-uncommon { background: var(--rarity-uncommon); }
.rarity-rare { background: var(--rarity-rare); }
.rarity-legendary { background: var(--rarity-legendary); box-shadow: 0 0 6px var(--rarity-legendary); }
.rarity-tool { background: var(--accent); }

#itemMenu {
  position: fixed; z-index: 60; width: 212px; background: var(--glass-2);
  border: 1px solid var(--glass-border); border-radius: 14px; padding: 12px;
  display: flex; flex-direction: column; gap: 7px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 50px rgba(0,0,0,.6); animation: panelIn .15s ease-out;
}
#itemMenuTitle { font-weight: 800; font-size: 14px; }
#itemMenuDesc { font-size: 11.5px; color: var(--text-dim); margin-bottom: 2px; line-height: 1.4; }
#itemMenu .btn { padding: 9px 12px; font-size: 13px; }

/* shop */
.shop-section { margin-bottom: 14px; }
#btnSellAll { width: 100%; }
.shop-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.shop-tab {
  flex: 1; padding: 9px; border-radius: 10px; cursor: pointer; font-family: inherit;
  font-size: 12.5px; font-weight: 700; color: var(--text-dim);
  background: rgba(2,20,30,.5); border: 1px solid rgba(140,200,255,.12);
}
.shop-tab.active { color: var(--text); background: rgba(56,189,248,.18); border-color: var(--accent); }
#shopItems { display: flex; flex-direction: column; gap: 8px; }
.shop-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px;
  background: rgba(2,20,30,.5); border: 1px solid rgba(140,200,255,.12);
}
.shop-item.owned { border-color: rgba(74,222,128,.4); background: rgba(22,101,52,.18); }
.shop-icon { width: 42px; height: 42px; flex-shrink: 0; }
.shop-info { flex: 1; min-width: 0; }
.shop-info b { font-size: 13.5px; display: block; }
.shop-info span { font-size: 10.5px; color: var(--text-dim); display: block; margin-top: 2px; line-height: 1.35; }
.shop-buy { display: flex; flex-direction: column; gap: 4px; align-items: stretch; flex-shrink: 0; }
.shop-buy .btn { padding: 8px 12px; font-size: 12px; white-space: nowrap; }
.owned-tag { font-size: 10.5px; font-weight: 800; color: #4ade80; text-align: center; }

/* ============ MINIGAME ============ */
#fishingPanel { background: rgba(2,10,16,.35); z-index: 55; align-items: flex-end; padding-bottom: 6vh; pointer-events: none; }
.fishing-card {
  pointer-events: auto; width: min(400px, 94vw); text-align: center;
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 20px; padding: 18px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 24px 70px rgba(0,0,0,.55); animation: panelIn .2s cubic-bezier(.2,1.4,.4,1);
}
.fishing-card h2 { font-size: 18px; }
.fishing-tip { font-size: 11.5px; color: var(--text-dim); margin: 4px 0 12px; }
.fishing-timer { height: 8px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; margin-bottom: 8px; }
#fishingTimeBar { height: 100%; width: 100%; border-radius: 99px; background: linear-gradient(90deg, #f87171, #fbbf24); transition: width .1s linear; }
.fishing-progress { position: relative; height: 30px; border-radius: 99px; background: rgba(2,20,30,.7); border: 1px solid var(--glass-border); overflow: hidden; margin-bottom: 12px; }
#fishingBar { height: 100%; width: 0%; background: linear-gradient(90deg, #0ea5e9, #2dd4bf); transition: width .09s ease-out; border-radius: 99px; }
#fishingPct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; text-shadow: 0 1px 3px #000; }
#fishingClickZone {
  width: 100%; padding: 20px; margin-bottom: 9px; font-size: 19px; font-weight: 900; letter-spacing: 1px;
  color: #06202e; border: none; border-radius: 16px; cursor: pointer; font-family: inherit;
  background: linear-gradient(135deg, #7dd3fc, #38bdf8, #2dd4bf); box-shadow: 0 8px 26px rgba(56,189,248,.4);
  display: flex; align-items: center; justify-content: center; gap: 10px; transition: transform .06s;
}
#fishingClickZone svg { width: 25px; height: 25px; }
#fishingClickZone:active { transform: scale(.95); }

/* ============ CATCH REVEAL ============ */
#catchReveal { background: rgba(2,8,14,.68); z-index: 70; cursor: pointer; }
.catch-card {
  position: relative; overflow: hidden; width: min(330px, 90vw); text-align: center;
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 22px; padding: 28px 22px 20px;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 30px 90px rgba(0,0,0,.6); animation: catchIn .45s cubic-bezier(.2,1.6,.35,1);
}
@keyframes catchIn { from { opacity: 0; transform: scale(.6) rotate(-4deg);} to { opacity: 1; transform: none;} }
.catch-glow { position: absolute; inset: -40%; background: radial-gradient(circle, rgba(125,211,252,.28), transparent 60%); animation: spin 5s linear infinite; }
@keyframes spin { to { transform: rotate(360deg);} }
.catch-card.r-legendary .catch-glow { background: radial-gradient(circle, rgba(251,191,36,.4), transparent 60%); }
.catch-card.r-rare .catch-glow { background: radial-gradient(circle, rgba(96,165,250,.35), transparent 60%); }
.catch-card.r-uncommon .catch-glow { background: radial-gradient(circle, rgba(74,222,128,.3), transparent 60%); }
.catch-rarity { position: relative; font-size: 11px; font-weight: 900; letter-spacing: 3px; margin-bottom: 12px; }
.catch-fish-icon { position: relative; width: 170px; height: 105px; margin: 0 auto 12px; animation: fishBob 1.7s ease-in-out infinite; }
@keyframes fishBob { 0%,100% { transform: translateY(0) rotate(-2.5deg);} 50% { transform: translateY(-9px) rotate(2.5deg);} }
.catch-card h2 { position: relative; font-size: 21px; margin-bottom: 6px; }
#catchPrice { position: relative; color: var(--text-dim); font-size: 13px; }
.catch-close-hint { position: relative; margin-top: 14px; font-size: 11px; color: var(--text-dim); opacity: .7; }

/* ============ TOASTS ============ */
#toasts {
  position: fixed; top: max(62px, calc(env(safe-area-inset-top) + 50px)); right: 12px; z-index: 90;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; max-width: min(330px, 86vw);
}
.toast {
  background: var(--glass); border: 1px solid var(--glass-border); border-left: 3px solid var(--accent);
  border-radius: 12px; padding: 10px 14px; font-size: 13px; font-weight: 600;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 26px rgba(0,0,0,.45); animation: toastIn .25s cubic-bezier(.2,1.4,.4,1);
}
.toast.warn { border-left-color: var(--accent-2); }
.toast.error { border-left-color: var(--danger); }
.toast.legend { border-left-color: #fbbf24; background: linear-gradient(90deg, rgba(251,191,36,.18), var(--glass)); }
.toast.fade { opacity: 0; transform: translateX(20px); transition: all .4s; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px);} to { opacity: 1; transform: none;} }

#fatalError { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: #06202e; color: var(--danger); font-size: 15px; padding: 24px; text-align: center; }
.panel::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-thumb { background: rgba(140,200,255,.25); border-radius: 8px; }

@media (max-width: 620px) {
  #hudName { display: none; }
  #heldCard { width: 150px; left: 8px; top: auto; bottom: max(180px, calc(env(safe-area-inset-bottom) + 180px)); transform: none; animation: none; }
  #heldIcon { width: 38px; height: 38px; }
  .hot-slot { width: 50px; height: 50px; padding: 7px; border-radius: 12px; }
  #hotbar { gap: 6px; }
  .inv-grid { grid-template-columns: repeat(4, 1fr); }
  .action-btn { min-width: 62px; padding: 9px 10px; font-size: 10px; }
  #prompt { bottom: 26%; font-size: 12.5px; }
}
