/* PolyQuest viewer stylesheet: circa-2015 CSS 3, flat lean-paint, Tizen 2.4 / Mali-400 & smartphone safe. */
* {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #234730;
    color: #f6f8fa;
    font-family: "Trebuchet MS", "Segoe UI", Arial, Helvetica, sans-serif;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#world, #world canvas {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: block;
}

#world {
    cursor: grab;
    touch-action: none;
}

#world.is-dragging { cursor: grabbing; }

/* Top-left HUD, Quest Card & Party Stack */
#hud-left-stack {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 164px;
    z-index: 6;
    pointer-events: none;
}

#hud-top {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-align-items: center;
    align-items: center;
    pointer-events: none;
}

.hud-pill {
    display: inline-block;
    vertical-align: middle;
    margin: 0 6px 5px 0;
    padding: 5px 10px;
    border-radius: 8px;
    background: rgba(18, 26, 24, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.28);
    font-size: 13px;
    line-height: 1.25;
    color: #f6f8fa;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.hud-tag {
    display: inline-block;
    padding: 1px 6px;
    margin-right: 6px;
    border-radius: 4px;
    background: #4fa86c;
    color: #101920;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.6px;
    vertical-align: middle;
}

.hud-title { font-weight: bold; vertical-align: middle; }
.hud-weather { color: #fde68a; font-weight: bold; font-size: 12px; }
.hud-stats { font-family: monospace; font-size: 13px; }
.stat-label { font-family: "Trebuchet MS", Arial, sans-serif; font-size: 10px; font-weight: bold; color: #a9c6be; letter-spacing: 0.6px; margin-right: 3px; }
.hud-divider { display: inline-block; width: 1px; height: 12px; margin: 0 7px; background: rgba(255, 255, 255, 0.25); vertical-align: middle; }

.hud-btn {
    pointer-events: auto;
    display: inline-block;
    vertical-align: middle;
    margin: 0 6px 5px 0;
    padding: 5px 11px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    background: rgba(20, 30, 36, 0.88);
    color: #ffffff;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.25;
    font-weight: bold;
    cursor: pointer;
}
.hud-btn-primary { background: #1e88e5; border-color: #7cc4ff; }
.hud-btn:hover, .hud-btn:active { background: #2e4254; }
.hud-btn-primary:hover, .hud-btn-primary:active { background: #1565c0; }

/* Active Quest Objective Card (click to open Quest Journal & switch active quest!) */
.quest-card {
    display: inline-block;
    max-width: 440px;
    margin: 2px 0 5px 0;
    padding: 7px 11px;
    border-radius: 9px;
    background: rgba(18, 28, 26, 0.88);
    border: 1px solid #e8b944;
    pointer-events: auto;
    cursor: pointer;
}
.quest-card:hover { border-color: #fde047; }

.quest-top {
    margin-bottom: 3px;
}

.quest-chapter {
    display: inline-block;
    padding: 1px 6px;
    margin-right: 6px;
    border-radius: 4px;
    background: #e8b944;
    color: #16181c;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.6px;
    vertical-align: middle;
}

.quest-title {
    font-size: 13px;
    font-weight: bold;
    color: #fff6d6;
    vertical-align: middle;
}

.quest-detail {
    font-size: 12px;
    line-height: 1.3;
    color: #d6e4de;
}

/* Party HUD (neat compact vertical stack along left edge so center world view stays completely open!) */
.party-hud {
    margin-top: 2px;
    width: 168px;
    max-width: 100%;
    pointer-events: none;
}

.p-card {
    display: block;
    width: 164px;
    padding: 4px 7px;
    margin: 0 0 4px 0;
    border-radius: 8px;
    background: rgba(18, 25, 28, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.24);
}
.p-card.is-downed { border-color: #ef4444; background: rgba(52, 18, 18, 0.90); }
.p-card.is-offline { border-color: #6b7280; opacity: 0.65; }

.p-row {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    margin-bottom: 3px;
}
.p-dot { width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; border: 1px solid #ffffff; -webkit-flex-shrink: 0; flex-shrink: 0; }
.p-name { -webkit-flex: 1; flex: 1; font-size: 12px; font-weight: bold; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.p-cls { font-size: 10px; font-weight: bold; padding: 1px 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.14); color: #fde68a; margin-left: 4px; }

.bar-line { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; }
.bar-lbl { width: 18px; margin-right: 5px; font-family: monospace; font-size: 10px; font-weight: bold; color: #ff8e8e; }
.mini-bar { -webkit-flex: 1; flex: 1; height: 7px; border-radius: 3px; background: #10171b; overflow: hidden; }
.mini-fill { height: 100%; width: 100%; }
.hp-fill { background: #ef4444; }
.p-prompt { margin-top: 3px; font-size: 10px; font-weight: bold; color: #7ee89c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Top-right controls + Minimap */
#top-right-stack {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 7;
    text-align: right;
    pointer-events: none;
}

#scene-controls {
    white-space: nowrap;
    margin-bottom: 6px;
    pointer-events: auto;
}

.scene-button {
    display: inline-block;
    vertical-align: top;
    width: 36px;
    height: 36px;
    padding: 7px;
    margin: 0 0 0 5px;
    border: 1px solid rgba(255, 255, 255, 0.40);
    border-radius: 8px;
    background: rgba(18, 26, 24, 0.86);
    color: #ffffff;
    cursor: pointer;
}
.scene-button svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sound-off, .is-muted .sound-on { display: none; }
.is-muted .sound-off { display: block; }
.fullscreen-exit, .is-fullscreen .fullscreen-enter { display: none; }
.is-fullscreen .fullscreen-exit { display: block; }

.minimap-wrap {
    display: inline-block;
    padding: 4px;
    border-radius: 10px;
    background: rgba(16, 24, 24, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.30);
    pointer-events: auto;
    cursor: pointer;
}
#minimap { display: block; width: 136px; height: 136px; border-radius: 6px; background: #1e3828; }
.minimap-label { margin-top: 3px; text-align: center; font-size: 10px; font-weight: bold; letter-spacing: 0.7px; color: #d6e6de; }

/* Banners & Toasts */
.center-banner {
    position: fixed;
    top: 22%;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    z-index: 9;
    padding: 11px 24px;
    border-radius: 12px;
    background: rgba(18, 26, 28, 0.95);
    border: 3px solid #ffd56b;
    color: #ffffff;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 1px;
    text-align: center;
    max-width: 88%;
    pointer-events: none;
}
.center-banner.is-info { border-color: #7cc4ff; font-size: 20px; }
.center-banner.is-warn { border-color: #f97316; background: #421c14; font-size: 19px; }

.tether-badge {
    position: fixed;
    top: 10px;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    z-index: 8;
    padding: 5px 14px;
    border-radius: 8px;
    background: #7c2d12;
    border: 1px solid #fbbf24;
    color: #fef3c7;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.8px;
    pointer-events: none;
}

.save-toast {
    position: fixed;
    bottom: 14px;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    z-index: 9;
    padding: 6px 14px;
    border-radius: 8px;
    background: #14532d;
    border: 1px solid #86efac;
    color: #dcfce7;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    pointer-events: none;
}

/* Story Dialogue Box */
.dialogue-box {
    position: fixed;
    bottom: 18px;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    z-index: 11;
    width: 660px;
    max-width: 92%;
    padding: 15px 18px;
    border-radius: 14px;
    background: rgba(16, 24, 28, 0.96);
    border: 2px solid #f5c344;
    color: #f8fafc;
}
.dialogue-head { margin-bottom: 6px; }
.dlg-speaker { font-size: 18px; color: #ffd56b; margin-right: 10px; }
.dlg-role { font-size: 12px; color: #9db8c4; }
.dlg-text { margin: 0 0 12px 0; font-size: 15px; line-height: 1.45; color: #eef5f8; }
.dlg-choices { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 0 -4px; }
.dlg-choice-btn {
    -webkit-flex: 1;
    flex: 1;
    min-width: 180px;
    margin: 4px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 2px solid #59c173;
    background: #1d4732;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    text-align: left;
}
.dlg-choice-btn:hover, .dlg-choice-btn:active { background: #266042; border-color: #bbf7d0; }

/* Lobby & Journal Overlay Cards */
.overlay-card {
    position: fixed;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    z-index: 10;
    width: 570px;
    max-width: 92%;
    max-height: 86%;
    overflow-y: auto;
    padding: 18px 20px;
    border-radius: 16px;
    background: rgba(18, 25, 29, 0.96);
    border: 2px solid rgba(255, 255, 255, 0.30);
    color: #f6f8fa;
}
.journal-card { width: 640px; border-color: #e8b944; }
.journal-head { display: -webkit-flex; display: flex; -webkit-justify-content: space-between; justify-content: space-between; -webkit-align-items: flex-start; align-items: flex-start; margin-bottom: 12px; }
.journal-section { margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; background: #1c2730; border: 1px solid rgba(255, 255, 255, 0.14); font-size: 13px; line-height: 1.4; }
.journal-section h3 { margin: 0 0 6px 0; font-size: 13px; letter-spacing: 0.8px; text-transform: uppercase; color: #ffd56b; }
.sq-row { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; padding: 6px 6px; border-top: 1px solid rgba(255, 255, 255, 0.08); border-radius: 6px; }
.sq-row:first-of-type { border-top: 0; }
.sq-row.sq-active { background: rgba(232, 185, 68, 0.14); border: 1px solid #e8b944; margin: 2px 0; }
.sq-body { -webkit-flex: 1; flex: 1; padding-right: 10px; }
.sq-meta { font-size: 11px; color: #cbd5e1; }
.sq-desc { font-size: 12px; color: #cbd5e1; margin-top: 2px; }
.sq-done { color: #86efac; }
.sq-track-btn {
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    padding: 5px 11px;
    border-radius: 7px;
    border: 1px solid #7cc4ff;
    background: #1e4b72;
    color: #ffffff;
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}
.sq-track-btn:hover { background: #266194; }
.sq-track-btn.is-active { background: #e8b944; border-color: #fef08a; color: #16181c; cursor: default; }
.sq-track-btn.is-done { background: #1c3a2a; border-color: #4ade80; color: #86efac; cursor: default; }

.overlay-header { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; margin-bottom: 10px; }
.overlay-icon { display: block; width: 58px; height: 58px; padding: 2px; border-radius: 12px; margin-right: 14px; background: #ffffff; -webkit-flex-shrink: 0; flex-shrink: 0; }
.overlay-eyebrow { font-size: 11px; font-weight: bold; letter-spacing: 1.4px; color: #ffd56b; text-transform: uppercase; }
.overlay-title { margin: 2px 0 0 0; font-size: 28px; line-height: 1.05; }
.story-intro { margin-bottom: 10px; padding: 8px 11px; border-radius: 9px; background: #1b2f26; border: 1px solid #3f8f5c; font-size: 13px; line-height: 1.38; color: #dff2e6; }

.save-banner { padding: 8px 11px; margin-bottom: 10px; border-radius: 9px; background: #2d2614; border: 1px solid #eab308; }
.save-banner-tag { font-size: 11px; font-weight: bold; letter-spacing: 0.8px; color: #fde047; }
.save-banner-meta { margin-top: 2px; font-size: 12px; color: #fef9c3; }

.roster-grid { margin: 0 -4px 10px -4px; font-size: 0; }
.roster-slot { display: inline-block; vertical-align: top; width: 50%; padding: 4px; font-size: 13px; }
.roster-card { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; padding: 7px 9px; border-radius: 8px; background: #212c34; border: 1px solid rgba(255, 255, 255, 0.14); }
.roster-card.is-human { background: #1d3c2d; border-color: #66d98a; }
.roster-swatch { width: 13px; height: 13px; border-radius: 4px; margin-right: 8px; border: 1px solid #ffffff; -webkit-flex-shrink: 0; flex-shrink: 0; }
.roster-name { -webkit-flex: 1; flex: 1; font-weight: bold; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.roster-role { font-size: 10px; font-weight: bold; padding: 2px 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.14); color: #fde68a; }

.class-picker-row { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin-bottom: 10px; }
.class-picker-lbl { font-size: 12px; font-weight: bold; color: #cbd5e1; margin-right: 8px; }
.cls-btn { margin: 3px; padding: 6px 11px; border-radius: 7px; border: 1px solid #526885; background: #1e293b; color: #e2e8f0; font-family: inherit; font-size: 12px; font-weight: bold; cursor: pointer; }
.cls-btn.is-active { background: #2e8b4e; border-color: #86efac; color: #ffffff; }

.overlay-actions { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 0 -5px; }
.btn-big { -webkit-flex: 1; flex: 1; min-width: 130px; margin: 5px; padding: 12px 14px; border-radius: 10px; border: 2px solid transparent; font-family: inherit; font-size: 15px; font-weight: bold; color: #ffffff; cursor: pointer; }
.btn-start { background: #2e9d4f; border-color: #7ee89c; }
.btn-start:hover, .btn-start:active { background: #237f3e; }
.btn-local { background: #1e7fd6; border-color: #7cc4ff; }
.btn-local:hover, .btn-local:active { background: #1665ad; }
.btn-muted { background: #344052; border-color: #5b6d87; }
.overlay-hint { margin: 9px 0 0 0; font-size: 12px; line-height: 1.35; color: #c2d4de; text-align: center; }

/* Touch-Anywhere Reticle & Local Controls */
.touch-guide { position: fixed; left: 0; top: 0; width: 112px; height: 112px; margin-left: -56px; margin-top: -56px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.50); background: rgba(18, 28, 34, 0.28); z-index: 6; pointer-events: none; }
.touch-knob { position: absolute; left: 50%; top: 50%; width: 42px; height: 42px; margin-left: -21px; margin-top: -21px; border-radius: 50%; border: 2px solid #ffffff; background: #38bdf8; pointer-events: none; }

.local-controls { position: fixed; left: 12px; bottom: 12px; z-index: 7; pointer-events: none; }
.local-hud-chip { pointer-events: auto; width: 268px; max-width: 82vw; padding: 8px 10px; border-radius: 10px; background: rgba(18, 25, 30, 0.90); border: 1px solid rgba(255, 255, 255, 0.30); }
.local-chip-top { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: space-between; justify-content: space-between; margin-bottom: 5px; }
.local-hero-tag { font-size: 11px; font-weight: bold; letter-spacing: 0.7px; color: #ffd56b; }
.local-exit-btn { padding: 3px 9px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.30); background: #334154; color: #ffffff; font-size: 11px; font-weight: bold; cursor: pointer; }
.local-action-btns { display: -webkit-flex; display: flex; margin: 7px -3px 0 -3px; }
.local-act-btn { -webkit-flex: 1; flex: 1; margin: 0 3px; padding: 8px 6px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.34); color: #ffffff; font-family: inherit; font-size: 12px; font-weight: bold; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.local-act-primary { background: #268646; border-color: #86efac; }
.local-act-skill { background: #6d28d9; border-color: #c4b5fd; }

/* Canonical Standard RCWeb QR Panel (exact v/style.css rules + content-box reset) */
#qrPanel {
    position: fixed;
    bottom: 14px;
    right: 14px;
    z-index: 6;
    width: 166px;
    -webkit-transform-origin: bottom right;
    transform-origin: bottom right;
    -webkit-transform: scale(0.62);
    transform: scale(0.62);
}
#qrPanel.is-compact { bottom: 14px; -webkit-transform: scale(0.44); transform: scale(0.44); opacity: 0.78; }
.rcRoomQrCodeLink, .rcRoomQrCodeLink * { -webkit-box-sizing: content-box; box-sizing: content-box; }
.rcRoomQrCodeLink {
    display: block; width: 150px; margin-left: auto; margin-right: auto;
    border: solid 8px #fff; border-radius: 8px; color: #fff; background-color: #fff;
    text-align: center; -webkit-transition: opacity 1s ease; transition: opacity 1s ease;
    text-decoration: none; -webkit-transform-origin: center; transform-origin: center;
    -webkit-transform: scale(1); transform: scale(1);
}
.rcTechLabel { background-color: #000; color: #fff; font-family: monospace; font-size: 13px; font-weight: bold; margin: 0 0 8px 0; padding: 4px; letter-spacing: 0.2em; border-radius: 8px 8px 0 0; }
.rcRoomQrCode { width: 150px; height: 150px; }
.rcRoomId { background-color: #000; color: #fff; font-family: monospace; font-size: 16px; padding: 4px; margin: 8px 0 0 0; letter-spacing: 0.25em; border-radius: 0 0 8px 8px; }

.conn-status { position: fixed; left: 14px; bottom: 12px; z-index: 9; font-size: 13px; color: #ffe08a; pointer-events: none; }
#diagnostics { position: fixed; left: 12px; bottom: 12px; z-index: 10; margin: 0; padding: 8px 10px; background: #141a24; color: #ffffff; font: 12px monospace; pointer-events: none; }
.no-script { position: fixed; top: 40%; width: 100%; text-align: center; }

/* Grand Champion 100% Completion Plaque & Gold Badges */
.hud-btn-gold { background: #b45309; border-color: #fde047; color: #fef9c3; }
.hud-btn-gold:hover { background: #d97706; }
.btn-gold { background: #d97706; border-color: #fde047; color: #ffffff; }
.btn-gold:hover { background: #f59e0b; }

.grand-card {
    max-width: 590px;
    border: 2px solid #facc15;
    background: rgba(18, 22, 34, 0.96);
    text-align: center;
    padding: 20px 24px;
    z-index: 12;
}
.grand-crest { font-size: 46px; line-height: 1; color: #fde047; margin-bottom: 4px; }
.grand-eyebrow { font-size: 11px; font-weight: bold; letter-spacing: 1.6px; color: #fde047; margin-bottom: 4px; }
.grand-title { margin: 0 0 6px 0; font-size: 28px; color: #ffffff; }
.grand-fellowship { margin: 0 0 12px 0; font-size: 13px; color: #cbd5e1; }
.grand-stats {
    display: -webkit-flex; display: flex;
    -webkit-flex-wrap: wrap; flex-wrap: wrap;
    -webkit-justify-content: center; justify-content: center;
    margin: 0 -4px 12px -4px;
}
.grand-stat-chip {
    margin: 4px;
    padding: 7px 11px;
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.92);
    border: 1px solid rgba(250, 204, 21, 0.45);
    min-width: 108px;
}
.grand-stat-lbl { display: block; font-size: 10px; font-weight: bold; letter-spacing: 0.8px; color: #94a3b8; }
.grand-stat-val { display: block; font-size: 15px; font-weight: bold; color: #fde047; margin-top: 2px; }
.grand-reward-box {
    text-align: left;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(120, 53, 15, 0.34);
    border: 1px solid #facc15;
    margin-bottom: 14px;
}
.grand-reward-tag { font-size: 10px; font-weight: bold; letter-spacing: 1.2px; color: #fde047; }
.grand-reward-name { font-size: 18px; font-weight: bold; color: #ffffff; margin: 2px 0 4px 0; }
.grand-reward-desc { font-size: 12px; line-height: 1.45; color: #fef3c7; }
.grand-actions { display: -webkit-flex; display: flex; -webkit-justify-content: center; justify-content: center; margin: 0 -5px; }
.grand-actions .btn-big { -webkit-flex: 1; flex: 1; margin: 0 5px; }

.journal-champ-banner {
    display: -webkit-flex; display: flex;
    -webkit-align-items: center; align-items: center;
    -webkit-justify-content: space-between; justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 12px;
    border-radius: 9px;
    background: rgba(120, 53, 15, 0.36);
    border: 1px solid #facc15;
}
.journal-champ-txt { font-size: 13px; color: #fef3c7; margin-right: 10px; }
.journal-champ-txt strong { color: #fde047; }

/* Lean-paint mode for weak signage devices (Samsung Tizen 2.4 / Mali-400) */
body.is-lean .hud-pill,
body.is-lean .hud-btn,
body.is-lean .scene-button,
body.is-lean .quest-card,
body.is-lean .p-card,
body.is-lean .minimap-wrap,
body.is-lean .overlay-card,
body.is-lean .dialogue-box,
body.is-lean .center-banner,
body.is-lean .local-hud-chip,
body.is-lean .grand-card,
body.is-lean .grand-stat-chip { background: #141c20; }
body.is-lean .hud-btn-primary { background: #1e88e5; }
body.is-lean .hud-btn-gold { background: #b45309; }
body.is-lean .grand-reward-box,
body.is-lean .journal-champ-banner { background: #3b2208; }
body.is-lean .rcRoomQrCodeLink { -webkit-transition: none; transition: none; }

/* Compact landscape (960x540 TV / tablet) */
@media (max-height: 580px) {
    .overlay-card { padding: 12px 14px; }
    .overlay-icon { width: 46px; height: 46px; }
    .overlay-title { font-size: 22px; }
    .btn-big { padding: 9px 12px; font-size: 14px; }
    .quest-card { max-width: 360px; padding: 5px 9px; }
    #minimap { width: 104px; height: 104px; }
    #qrPanel { -webkit-transform: scale(0.48); transform: scale(0.48); }
    #qrPanel.is-compact { bottom: 10px; -webkit-transform: scale(0.36); transform: scale(0.36); }
}

/* Narrow portrait & smartphone viewer layout (450x960, 390x844) */
@media (max-width: 560px) {
    #hud-left-stack { top: 6px; left: 6px; right: 78px; }
    .hud-pill { padding: 3px 7px; font-size: 11px; margin: 0 4px 4px 0; border-radius: 6px; }
    .hud-btn { padding: 3px 8px; font-size: 11px; margin: 0 4px 4px 0; border-radius: 6px; }
    .quest-card { max-width: 100%; padding: 5px 8px; }
    .quest-title { font-size: 12px; }
    .quest-detail { font-size: 11px; }
    #top-right-stack { top: 6px; right: 6px; }
    .scene-button { width: 30px; height: 30px; padding: 5px; }
    .minimap-wrap { display: none !important; }
    .p-card { width: 132px; padding: 3px 6px; }
    .roster-slot { width: 100%; }
    .center-banner { font-size: 18px; padding: 8px 14px; }
    .dialogue-box { bottom: 10px; padding: 12px 14px; }
    .dlg-text { font-size: 13px; }
    .grand-card { padding: 14px 12px; }
    .grand-crest { font-size: 34px; }
    .grand-title { font-size: 21px; }
    .grand-stat-chip { min-width: 92px; padding: 5px 8px; }
    .grand-actions { -webkit-flex-direction: column; flex-direction: column; margin: 0; }
    .grand-actions .btn-big { margin: 4px 0; }
    #qrPanel { display: none !important; }
}
