.duel-page { --blue-team:#307fa9; --red-team:#c56857; background:#393052; }
.duel-stage { position:relative; width:100%; height:100dvh; min-height:300px; overflow:clip; isolation:isolate; }
#duel-world { position:absolute; inset:0; width:100%; height:100%; outline:none; touch-action:none; }
.duel-pane { position:absolute; top:0; bottom:0; width:50%; pointer-events:none; --team:var(--blue-team); }
.duel-pane.blue { left:0; }
.duel-pane.red { left:50%; --team:var(--red-team); }
.duel-station-labels { position:absolute; inset:0; z-index:2; }
.duel-player-heading { position:absolute; top:8px; left:18px; right:18px; display:flex; align-items:center; gap:9px; color:#fff5de; height:34px; width:max-content; padding:3px 10px 3px 3px; background:#39334bdd; border:1px solid #d8c39199; border-radius:19px; }
.duel-player-heading span { display:flex; flex-direction:column; }
.duel-player-heading b { font-size:19px; letter-spacing:2px; }
.duel-animal-name { display:none; }
.duel-portrait { width:34px; height:34px; object-fit:contain; background:#fff1d9; border:2px solid var(--team); border-radius:50%; }
.duel-score { font-size:26px; min-width:60px; color:#f9e4ab; margin-left:14px; }
.duel-combo { color:#e7d090; font-size:12px; white-space:nowrap; }
.duel-pane.red .duel-player-heading { left:82px; right:145px; }
.match-center { position:absolute; top:10px; left:50%; transform:translateX(-50%); width:112px; text-align:center; z-index:5; color:#fff2cb; border:2px solid #ddbc76; border-radius:18px; background:#433657; padding:6px 10px 3px; box-shadow:0 4px 0 #25213b88; pointer-events:none; }
.match-center span { display:block; font-size:11px; letter-spacing:3px; }
.match-center strong { display:block; font-size:26px; font-variant-numeric:tabular-nums; line-height:1.25; }
.match-center small { display:block; font-size:10px; color:#d9c28e; }
.match-center.urgent { color:#ffd1a1; border-color:#ef9e6c; }
.duel-tools { position:absolute; right:14px; top:14px; display:flex; gap:7px; z-index:6; }
.duel-tools .icon-button { width:36px; height:36px; font-size:21px; padding:8px; background:#51445f; border-color:#ddbd89; }
.duel-tools svg { width:20px; height:20px; }
.duel-orders { position:absolute; left:18px; right:18px; top:54px; display:flex; width:auto; max-width:none; padding-top:0; gap:8px; min-height:72px; pointer-events:none; }
.duel-pane.red .duel-orders { justify-content:flex-end; }
.duel-orders .order-card { flex:1 1 0; width:calc((100% - 8px)/2); min-width:0; max-width:250px; height:72px; padding:6px 8px; border:2px solid #dec18a; }
.duel-orders .ticket-tab { margin:-7px -8px 3px; padding:3px 8px; font-size:9px; }
.duel-orders .order-head { position:absolute; left:8px; top:27px; gap:4px; height:28px; }
.duel-orders .order-head .dish-thumb { width:32px; height:29px; }
.duel-orders .order-head h3 { position:static; width:auto; margin:0; background:none; font-size:12px; max-width:62px; }
.duel-orders .order-countdown { font-size:12px; }
.duel-orders .order-recipe { display:flex; height:33px; margin-top:5px; margin-left:105px; gap:2px; justify-content:flex-start; }
.duel-orders .ingredient-request { width:29px; min-width:0; }
.duel-orders .ingredient-picture img { width:23px; height:23px; }
.duel-orders .ingredient-picture b { font-size:9px; right:-4px; }
.duel-orders .ingredient-picture { height:22px; }
.duel-orders .prep-steps { height:10px; }
.duel-orders .prep-steps svg { width:12px; height:12px; }
.duel-orders .order-bar { position:absolute; left:8px; right:8px; bottom:5px; height:4px; margin:0; }
.duel-orders .spell-haste { border-color:#e4ab3f; box-shadow:0 0 0 2px #ffe28e88,0 5px 0 #98795066; }
.duel-orders .spell-haste .order-countdown::before { content:"↠ "; color:#ae7226; }
.duel-controls { position:absolute; left:18px; right:18px; bottom:10px; display:flex; justify-content:space-between; align-items:flex-end; gap:12px; pointer-events:none; z-index:5; }
.duel-joystick { width:76px; height:76px; flex-shrink:0; border:2px solid #f6e9c8aa; border-radius:50%; position:relative; background:#39345288; touch-action:none; pointer-events:auto; }
.joystick-direction { position:absolute; inset:5px; display:grid; place-items:center; font-size:64px; color:#fff0c333; font-weight:200; }
.duel-knob { position:absolute; width:34px; height:34px; left:calc(50% - 23px); top:calc(50% - 23px); border-radius:50%; background:#fff0d0; border:2px solid #fff7e6; box-shadow:0 3px 0 #312d4a66; }
.duel-joystick small { position:absolute; bottom:5px; width:100%; text-align:center; font-size:10px; color:#fff0d0; }
.duel-actions { display:flex; gap:7px; pointer-events:auto; }
.duel-action { width:64px; height:74px; border:2px solid #ebd6b0; background:#335d64e8; border-radius:18px; color:#fff7df; padding:5px 2px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; touch-action:none; box-shadow:0 4px 0 #23374288; }
.red .duel-action { background:#845344ec; }
.duel-action svg { width:27px; height:27px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linejoin:round; stroke-linecap:round; }
.duel-action b { font-size:13px; }
.duel-action kbd { border:none; box-shadow:none; background:none; color:#eeddbb; padding:0; font-size:9px; white-space:nowrap; }
.duel-action:disabled { opacity:.5; cursor:default; }
.duel-action.pressed { transform:translateY(3px); box-shadow:0 1px 0 #23374288; }
.duel-action.duel-cast { background:#635083ef; border-color:#e7c979; }
.duel-cast[data-spell="ice"] { background:#36798aee; }
.duel-cast[data-spell="haste"] { background:#98712fea; }
.duel-slot-icon { width:29px; height:29px; display:grid; place-items:center; font-size:27px; }
.duel-slot-icon .magic-prop-icon { width:37px; height:37px; object-fit:contain; filter:drop-shadow(0 2px 1px #25132b55); }
.duel-held { position:absolute; left:112px; right:234px; bottom:44px; display:flex; gap:4px; align-items:center; color:#fff6df; background:#39304ce3; border:1px solid #dac28e; padding:2px 8px; border-radius:10px; white-space:nowrap; font-size:12px; }
.duel-held img { width:28px; height:28px; object-fit:contain; }
.duel-held img[hidden] { display:none; }
.duel-held.empty-hand { color:#d6cdbd; }
.duel-message { position:absolute; left:112px; right:234px; bottom:15px; background:#fff3dbe8; border:1px solid #d5b984; border-radius:8px; color:#4e453e; font-size:11px; padding:4px 9px; opacity:0; }
.duel-message.visible { opacity:1; }
.duel-state-strip { position:absolute; left:248px; right:12px; top:16px; display:flex; flex-wrap:wrap; justify-content:flex-start; gap:4px; font-size:10px; }
.duel-pane.red .duel-state-strip { left:300px; right:145px; }
.duel-state-strip span { padding:1px 7px; background:#ede2cbe6; border:1px solid #d3b774; color:#51425d; border-radius:12px; }
.duel-state-strip .status-iceUntilTick { background:#d0eef6ed; border-color:#74c9de; color:#275e75; }
.duel-state-strip .status-hasteUntilTick { background:#fff0c6ed; color:#8b621f; }
.duel-state-strip .status-confusionUntilTick { background:#e6d8feed; color:#72519b; }
.duel-state-strip .status-incoming { background:#ffe5cc; color:#975139; }
.duel-state-strip .status-shield { background:#d8f1e7ed; color:#3c7962; }
.duel-modal-wrap { position:absolute; inset:0; z-index:20; display:flex; align-items:center; justify-content:center; background:#26223b96; padding:18px; backdrop-filter:blur(3px); }
.duel-modal-wrap.hidden { display:none; }
.duel-modal { width:min(530px,95vw); max-height:92dvh; overflow:auto; border:3px solid #dcbc83; border-radius:25px; background:#fff3dc; color:#4b414e; padding:26px 32px; text-align:center; box-shadow:0 10px 0 #28203d66; position:relative; }
.duel-lobby { width:min(740px,95vw); }
.duel-brand { display:flex; align-items:center; justify-content:center; gap:8px; color:#604b7b; font-size:19px; font-weight:800; letter-spacing:3px; }
.brand-rune { border:2px solid #9774ab; border-radius:10px; width:30px; height:30px; display:grid; place-items:center; font-size:24px; }
.duel-kicker { font-size:11px; letter-spacing:2px; color:#918074; margin:13px 0 8px; }
.duel-modal h2 { font-size:30px; color:#594267; margin:8px 0 13px; }
.duel-modal p { font-size:13px; line-height:1.7; }
.duel-intro { color:#837464; }
.duel-seats { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:18px 0; text-align:left; }
.duel-seat { display:flex; align-items:center; gap:9px; padding:10px 12px; background:#e1ece7; border:1px solid #a5c6c5; border-radius:14px; }
.duel-seat.red { background:#f4e1d4; border-color:#d9b49b; }
.duel-seat img { width:64px; height:70px; object-fit:contain; }
.duel-seat span { display:flex; flex-direction:column; gap:3px; min-width:0; width:100%; }
.duel-seat b { font-size:13px; color:#3b7287; }
.duel-seat.red b { color:#a66250; }
.duel-seat select { width:100%; border:1px solid #d4be94; background:#fff7e7; color:#564651; border-radius:6px; padding:4px; font-size:14px; }
.duel-seat small { font-size:10px; color:#877769; white-space:nowrap; }
.magic-guide { display:flex; gap:9px; margin:0 0 18px; }
.magic-guide-item { flex:1; min-width:0; padding:9px 5px; border:1px solid #cab8d3; border-radius:13px; background:#eee3f1; display:flex; flex-direction:column; align-items:center; gap:4px; }
.magic-guide-item .magic-prop-icon { width:57px; height:57px; object-fit:contain; filter:drop-shadow(0 2px 1px #34233c33); }
.magic-guide-item b { font-size:13px; }
.magic-guide-item small { font-size:10px; color:#826e74; white-space:nowrap; }
.magic-guide-item.magic-ice { background:#e1f0f1; border-color:#acd1d5; }
.magic-guide-item.magic-haste { background:#f7edcd; border-color:#e0ca8d; }
.duel-modal .primary-button { width:min(300px,100%); min-height:48px; background:#73528c; box-shadow:0 4px 0 #4e3b64; }
.duel-modal .text-button { color:#917664; display:block; margin:9px auto 0; padding:5px 9px; }
.single-return { text-decoration:none; font-size:13px; }
.duel-load { font-size:10px!important; color:#978675; min-height:12px; margin:9px 0 0; }
.duel-result-scores { display:flex; gap:12px; margin:18px 0; }
.duel-result-scores>div { flex:1; display:flex; flex-direction:column; align-items:center; border:2px solid #bdccd1; border-radius:14px; padding:12px; background:#e8efec; }
.duel-result-scores>div.red { background:#f1e1d5; border-color:#d6b6a4; }
.duel-result-scores .winner { outline:3px solid #e0bf67; }
.duel-result-scores img { height:70px; width:70px; object-fit:contain; }
.duel-result-scores strong { font-size:38px; color:#6c516c; }
.duel-result-scores small { font-size:11px; }
.duel-help-card { text-align:left; width:min(690px,94vw); }
.duel-help-card h2,.duel-help-card .duel-kicker { text-align:center; }
.duel-book-recipe { display:flex; align-items:center; gap:12px; padding:9px 0; border-bottom:1px solid #e3d4b5; }
.duel-book-recipe img { width:64px; height:56px; object-fit:contain; }
.duel-book-recipe h3 { margin:0; font-size:15px; }
.duel-book-recipe p { margin:3px 0; font-size:12px; }
.duel-page .rotate-notice { z-index:40; }
.station-label.frozen { opacity:1; color:#d8f5ff; background:#386675e8; border-color:#8cd9ec; }
.mode-links { display:flex; gap:10px; align-items:center; font-size:13px; margin:12px 0 0; }
.mode-links span,.mode-links a { padding:7px 12px; border:1px solid #d2bd94; border-radius:10px; text-decoration:none; color:#685679; background:#f2e6f1; }
.mode-links span { color:#386f64; background:#e0eddf; }
@media (max-height:600px) and (orientation:landscape) {
  .duel-player-heading { top:6px; left:10px; right:10px; height:28px; gap:5px; }
  .duel-player-heading b { font-size:13px; letter-spacing:1px; }
  .duel-animal-name { display:none; }
  .duel-portrait { width:28px; height:28px; }
  .duel-score { font-size:20px; margin-left:5px; min-width:36px; }
  .duel-combo { font-size:9px; }
  .duel-pane.red .duel-player-heading { left:52px; right:105px; }
  .match-center { width:81px; top:5px; padding:4px 8px; border-radius:13px; }
  .match-center span { font-size:8px; letter-spacing:1px; }
  .match-center strong { font-size:20px; }
  .match-center small { display:none; }
  .duel-tools { right:8px; top:6px; gap:4px; }
  .duel-tools .icon-button { width:28px; height:28px; padding:5px; font-size:15px; }
  .duel-tools svg { width:16px; height:16px; }
  .duel-orders { left:10px; right:10px; top:38px; min-height:48px; gap:5px; }
  .duel-pane.blue .duel-orders { right:44px; }
  .duel-pane.red .duel-orders { left:44px; }
  .duel-orders .order-card { height:48px; width:calc((100% - 5px)/2); max-width:190px; padding:2px 5px; border-radius:6px; }
  .duel-orders .ticket-tab { margin:-3px -5px 0; padding:1px 5px; font-size:8px; }
  .duel-orders .order-head { left:5px; top:17px; height:23px; }
  .duel-orders .order-head .dish-thumb { width:24px; height:25px; }
  .duel-orders .order-head h3 { display:none; }
  .duel-orders .order-recipe { height:25px; margin-left:27px; margin-top:3px; }
  .duel-orders .order-countdown { font-size:9px; }
  .duel-orders .ingredient-request { width:24px; }
  .duel-orders .ingredient-picture img { width:21px; height:21px; }
  .duel-orders .ingredient-picture b { font-size:7px; right:-3px; }
  .duel-orders .prep-steps { display:none; }
  .duel-orders .order-bar { left:5px; right:5px; bottom:3px; height:3px; }
  .duel-state-strip { top:12px; left:142px; gap:2px; font-size:8px; }
  .duel-pane.red .duel-state-strip { left:190px; right:100px; }
  .duel-state-strip span { padding:0 5px; }
  .duel-controls { bottom:8px; left:10px; right:10px; gap:5px; }
  .duel-joystick { width:63px; height:63px; }
  .joystick-direction { font-size:49px; }
  .duel-knob { width:32px; height:32px; left:calc(50% - 16px); top:calc(50% - 16px); }
  .duel-joystick small { font-size:8px; bottom:2px; }
  .duel-actions { gap:4px; }
  .duel-action { width:51px; height:57px; border-radius:13px; padding:3px 1px; }
  .duel-action svg,.duel-slot-icon,.duel-slot-icon svg { width:21px; height:21px; }
  .duel-action b { font-size:10px; }
  .duel-action kbd { font-size:7px; }
  .duel-held { bottom:38px; left:82px; right:178px; padding:2px 5px; border:none; background:#39304cd4; font-size:9px; white-space:normal; min-height:22px; }
  .duel-held img { width:24px; height:24px; }
  .duel-message { bottom:8px; left:82px; right:178px; font-size:8px; padding:2px 5px; }
  .duel-modal-wrap { padding:8px; }
  .duel-modal { padding:15px 24px; border-radius:18px; }
  .duel-lobby { width:min(670px,94vw); max-height:94dvh; }
  .duel-brand { font-size:15px; }
  .brand-rune { width:24px; height:24px; font-size:19px; }
  .duel-kicker { margin:6px 0 4px; font-size:9px; }
  .duel-modal h2 { font-size:23px; margin:4px 0 6px; }
  .duel-intro { margin:4px 0; font-size:11px!important; }
  .duel-intro br { display:none; }
  .duel-seats { margin:9px 0; gap:8px; }
  .duel-seat { padding:5px 9px; }
  .duel-seat img { width:43px; height:43px; }
  .duel-seat b { font-size:11px; }
  .duel-seat select { padding:2px 4px; font-size:12px; }
  .duel-seat small { font-size:8px; }
  .magic-guide { margin-bottom:10px; gap:7px; }
  .magic-guide-item { flex-direction:row; flex-wrap:wrap; justify-content:center; padding:5px; gap:3px; }
  .magic-guide-item svg { width:20px; height:20px; }
  .magic-guide-item b { font-size:11px; }
  .magic-guide-item small { width:100%; text-align:center; font-size:8px; }
  .duel-modal .primary-button { min-height:37px; }
  .duel-modal .text-button { margin-top:5px; padding:1px; font-size:11px; }
  .duel-load { margin-top:3px; }
}
