﻿html, body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: sans-serif;
    background: #071a49;
    color: #fff;
    touch-action: manipulation;
}

body {
    position: fixed;
    inset: 0;
}

.hidden {
    display: none !important;
}

#game-container.mobile-field-ui {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    isolation: isolate;
    --bg-design-image: none;
    --bg-design-opacity: 0.28;
    background:
        radial-gradient(circle at center, rgba(50,120,255,0.18) 0%, rgba(3,14,45,0.08) 45%, rgba(1,7,22,0.92) 100%),
        linear-gradient(180deg, #0d2d7a 0%, #071a49 55%, #041130 100%);
}

#game-container.mobile-field-ui::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: var(--bg-design-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: var(--bg-design-opacity);
    filter: saturate(0.72) brightness(1.02) contrast(0.9) blur(1px);
}

#game-container.mobile-field-ui.theme-default {
    background:
        radial-gradient(circle at center, rgba(50,120,255,0.18) 0%, rgba(3,14,45,0.08) 45%, rgba(1,7,22,0.92) 100%),
        linear-gradient(180deg, #0d2d7a 0%, #071a49 55%, #041130 100%);
}

#game-container.mobile-field-ui.theme-white {
    background:
        radial-gradient(circle at center, rgba(96, 132, 189, 0.12) 0%, rgba(210, 224, 245, 0.3) 52%, rgba(240, 245, 255, 0.95) 100%),
        linear-gradient(180deg, #f8fbff 0%, #eef3ff 52%, #dbe7ff 100%);
}

#game-container.mobile-field-ui.theme-sky {
    background:
        radial-gradient(circle at center, rgba(170, 228, 255, 0.28) 0%, rgba(84, 162, 223, 0.2) 42%, rgba(36, 82, 135, 0.82) 100%),
        linear-gradient(180deg, #56b7f0 0%, #2e87c8 56%, #1f5d9d 100%);
}

#game-container.mobile-field-ui.theme-forest {
    background:
        radial-gradient(circle at center, rgba(165, 222, 141, 0.2) 0%, rgba(56, 120, 90, 0.18) 45%, rgba(10, 47, 44, 0.9) 100%),
        linear-gradient(180deg, #2f7a57 0%, #1f5c4a 56%, #0f3733 100%);
}

#game-container.mobile-field-ui.theme-sunset {
    background:
        radial-gradient(circle at center, rgba(255, 193, 133, 0.26) 0%, rgba(201, 93, 111, 0.2) 46%, rgba(67, 35, 89, 0.86) 100%),
        linear-gradient(180deg, #f59b6a 0%, #b65a8b 52%, #55306f 100%);
}

.field-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image:
        linear-gradient(rgba(80,170,255,0.14) 1px, transparent 1px),
        linear-gradient(90deg, rgba(80,170,255,0.14) 1px, transparent 1px);
    background-size: 34px 34px;
    transform: perspective(760px) rotateX(70deg) scale(1.55);
    transform-origin: center center;
    top: 12%;
    opacity: 0.72;
    pointer-events: none;
}

.top-hud {
    position: absolute;
    top: env(safe-area-inset-top, 0);
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 8px;
    box-sizing: border-box;
    pointer-events: none;
}

.turn-phase-box,
.header-actions {
    pointer-events: auto;
}

.turn-phase-box {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding: 7px 9px;
    border-radius: 12px;
    background: rgba(4, 10, 30, 0.72);
    border: 1px solid rgba(120, 190, 255, 0.45);
    box-shadow: 0 4px 18px rgba(0,0,0,0.28);
    backdrop-filter: blur(4px);
}

#turn-indicator,
#phase-indicator,
#cpu-status {
    font-size: 11px;
    font-weight: bold;
    line-height: 1.2;
}

#cpu-status {
    color: #8fd4ff;
    min-height: 14px;
}

.header-actions {
    display: flex;
    gap: 6px;
}

.hud-button {
    border: none;
    border-radius: 12px;
    padding: 9px 11px;
    font-size: 11px;
    font-weight: 900;
    color: #fff;
    background: rgba(35, 96, 200, 0.92);
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

.hud-button.danger {
    background: rgba(150, 43, 58, 0.92);
}

.discard-banner {
    position: absolute;
    left: 50%;
    top: 38%;
    transform: translate(-50%, -50%);
    z-index: 24;
    min-width: 200px;
    width: min(60vw, 260px);
    max-width: 68vw;
    text-align: center;
    padding: 9px 12px;
    border-radius: 14px;
    background: rgba(255, 214, 120, 0.95);
    color: #5f3300;
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 8px 24px rgba(0,0,0,0.22);
}

.duel-field {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 62px 8px 86px 8px;
    box-sizing: border-box;
}

.field-side {
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 2;
}

.cpu-side {
    min-height: 21vh;
}

.player-side {
    min-height: 30vh;
}

.player-hud {
    display: flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    max-width: 56vw;
    padding: 5px 7px;
    border-radius: 14px;
    background: rgba(4, 10, 30, 0.72);
    border: 1px solid rgba(120, 190, 255, 0.38);
    box-shadow: 0 4px 18px rgba(0,0,0,0.22);
    backdrop-filter: blur(4px);
}

.cpu-hud {
    align-self: flex-start;
}

.cpu-top-row {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.player-main-hud {
    align-self: flex-end;
}

.character-icon {
    width: 64px;
    height: 64px;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

.character-icon.battle-mode-chef {
    position: relative;
    overflow: hidden;
    border-radius: 50%;
    border: 1.3px solid rgba(255, 234, 177, 0.58);
    filter: none;
    background-repeat: no-repeat;
    background-color: transparent;
    animation: none;
    box-shadow: 0 0 0 1px rgba(255, 244, 210, 0.34), 0 2px 7px rgba(0, 0, 0, 0.22);
}

.character-icon.battle-mode-chef::before,
.character-icon.battle-mode-chef::after {
    content: none;
    display: none;
}

.character-icon.battle-mode-chef::before {
    inset: auto;
    background: none;
    filter: none;
    animation: none;
}

.character-icon.battle-mode-chef::after {
    inset: auto;
    border: none;
    box-shadow: none;
    animation: none;
}

@keyframes mobile-battle-mode-icon-glow {
    0% {
        transform: scale(1);
        filter: saturate(1.1) contrast(1.05) brightness(1.03)
            drop-shadow(0 0 3px rgba(255, 214, 130, 0.56))
            drop-shadow(0 0 6px rgba(255, 166, 52, 0.36));
    }
    100% {
        transform: scale(1.015);
        filter: saturate(1.18) contrast(1.08) brightness(1.08)
            drop-shadow(0 0 5px rgba(255, 236, 174, 0.76))
            drop-shadow(0 0 9px rgba(255, 192, 78, 0.48));
    }
}

@keyframes mobile-battle-mode-icon-halo-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes mobile-battle-mode-icon-halo-pulse {
    0%, 100% { opacity: 0.34; transform: scale(0.99); }
    50% { opacity: 0.72; transform: scale(1.02); }
}

.character-icon.char-chizuru,
.start-char-portrait.char-chizuru {
    background-image: url("../assets/images/character-icons/chizuru-icons.png");
    background-size: 380% auto;
}

.character-icon.char-chizuru.face-normal,
.start-char-portrait.char-chizuru { background-position: calc(0% - 14px) 38%; }
.character-icon.char-chizuru.face-happy { background-position: calc(50% - 8px) 38%; }
.character-icon.char-chizuru.face-worried { background-position: calc(100% - 2px) 38%; }

.character-icon.char-mai,
.start-char-portrait.char-mai {
    background-image: url("../assets/images/character-icons/mai-icons.png");
    background-size: 380% auto;
}

.character-icon.char-mai.face-normal,
.start-char-portrait.char-mai { background-position: calc(0% - 14px) 38%; }
.character-icon.char-mai.face-happy { background-position: calc(50% - 8px) 38%; }
.character-icon.char-mai.face-worried { background-position: calc(100% - 2px) 38%; }

.character-icon.char-takumi,
.start-char-portrait.char-takumi {
    background-image: url("../assets/images/character-icons/takumi-icons.png");
    background-size: 380% auto;
}

.character-icon.char-takumi.face-normal,
.start-char-portrait.char-takumi { background-position: calc(0% - 14px) 32%; }
.character-icon.char-takumi.face-happy { background-position: calc(50% - 8px) 32%; }
.character-icon.char-takumi.face-worried { background-position: calc(100% - 2px) 32%; }

.character-icon.char-akatsuki,
.start-char-portrait.char-akatsuki {
    background-image: url("../assets/images/character-icons/akatsuki-icons.png");
    background-size: 380% auto;
}

.character-icon.char-akatsuki.face-normal,
.start-char-portrait.char-akatsuki { background-position: calc(0% - 14px) 32%; }
.character-icon.char-akatsuki.face-happy { background-position: calc(50% - 8px) 32%; }
.character-icon.char-akatsuki.face-worried { background-position: calc(100% - 2px) 32%; }

.character-icon.battle-mode-chef.char-chizuru {
    background-image: url("../assets/images/battle-mode-icons/chizuru-battle-mode-icon.png");
    background-size: 368% auto;
    background-position: 50% 16%;
}

.character-icon.battle-mode-chef.char-mai {
    background-image: url("../assets/images/battle-mode-icons/mai-battle-mode-icon.png");
    background-size: 368% auto;
    background-position: 50% 16%;
}

.character-icon.battle-mode-chef.char-takumi {
    background-image: url("../assets/images/battle-mode-icons/takumi-battle-mode-icon.png");
    background-size: 384% auto;
    background-position: 50% 15%;
}

.character-icon.battle-mode-chef.char-akatsuki {
    background-image: url("../assets/images/battle-mode-icons/akatsuki-battle-mode-icon.png");
    background-size: 384% auto;
    background-position: 50% 15%;
}

.hud-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.hud-name {
    font-size: 12px;
    font-weight: 900;
    color: #ffffff;
}

.hud-score {
    font-size: 11px;
    font-weight: 900;
    color: #ffedb3;
}

.hud-skill-name {
    font-size: 10px;
    font-weight: 900;
    color: #b9e4ff;
}

.hud-skill-state {
    font-size: 10px;
    color: #e4f3ff;
}

.hud-skill-button {
    margin-top: 2px;
    width: fit-content;
    border: 1px solid rgba(172, 221, 255, 0.5);
    border-radius: 999px;
    background: rgba(255,255,255,0.16);
    color: #eaf8ff;
    font-size: 10px;
    font-weight: 900;
    padding: 3px 8px;
}

.hud-skill-button:disabled {
    opacity: 0.5;
}

.hud-skill-button.ready {
    border-color: #ffb247;
    background: linear-gradient(180deg, #ffefb9 0%, #ffca78 100%);
    color: #5f3400;
    box-shadow: 0 0 10px rgba(255, 187, 88, 0.45);
    animation: mobile-skill-ready-glow 1.6s ease-in-out infinite;
}

#skill-confirm-yes-button.ready {
    border-color: #ffb247;
    background: linear-gradient(180deg, #ffefb9 0%, #ffca78 100%);
    color: #5f3400;
    box-shadow: 0 0 10px rgba(255, 187, 88, 0.45);
    animation: mobile-skill-ready-glow 1.6s ease-in-out infinite;
}

@keyframes mobile-skill-ready-glow {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.14); }
    100% { filter: brightness(1); }
}

.zone-block {
    background: rgba(5, 17, 44, 0.46);
    border: 1px solid rgba(133, 196, 255, 0.28);
    border-radius: 12px;
    padding: 5px;
    box-sizing: border-box;
    backdrop-filter: blur(3px);
}

.zone-label {
    font-size: 9px;
    font-weight: 900;
    color: #9fd5ff;
    margin-bottom: 3px;
    letter-spacing: 0.4px;
}

.cpu-middle-row,
.player-middle-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

.cpu-hand-zone,
.player-hand-zone {
    min-height: 78px;
}

.realtime-log-panel {
    flex: 1;
    min-width: 0;
    max-width: 45vw;
    padding: 5px 6px;
    border-radius: 12px;
    border: 1px solid rgba(133, 196, 255, 0.3);
    background: rgba(4, 10, 30, 0.72);
    box-shadow: 0 4px 18px rgba(0,0,0,0.22);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.realtime-log-panel:focus-visible {
    outline: 2px solid #9fd5ff;
    outline-offset: 2px;
}

.realtime-log-title {
    font-size: 9px;
    font-weight: 900;
    color: #9fd5ff;
    margin-bottom: 3px;
}

.realtime-log-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 64px;
    overflow: hidden;
}

.realtime-log-entry {
    font-size: 9px;
    line-height: 1.2;
    color: #dff2ff;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.center-field {
    position: absolute;
    inset: 22% 0 31% 0;
    z-index: 4;
    pointer-events: none;
}

.deck-discard-cluster {
    position: absolute;
    left: 50%;
    top: 49%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

.pile {
    width: 62px;
    height: 82px;
    border-radius: 10px;
    background: rgba(235, 237, 242, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #0b1e4d;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    border: 2px solid rgba(255,255,255,0.4);
    box-sizing: border-box;
    padding: 4px;
}

.deck-pile {
    background-image: url("../assets/images/card-back.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.deck-pile .pile-title,
.deck-pile .pile-count {
    background: rgba(255,255,255,0.86);
    padding: 2px 6px;
    border-radius: 999px;
}

.clickable-pile {
    cursor: pointer;
}

.pile-title {
    font-size: 10px;
    font-weight: 900;
    margin-bottom: 4px;
}

.pile-count {
    font-size: 18px;
    font-weight: 900;
}

.field-center-actions {
    position: absolute;
    right: 8px;
    top: 55%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 96px;
    pointer-events: auto;
}

.main-action {
    border: none;
    border-radius: 12px;
    padding: 11px 8px;
    font-size: 11px;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(180deg, #42c8ff 0%, #1d6acb 100%);
    box-shadow: 0 5px 18px rgba(0,0,0,0.28);
}

.main-action.accent {
    background: linear-gradient(180deg, #ffc857 0%, #cf7d12 100%);
}

.main-action:disabled {
    opacity: 0.45;
}

.main-action.has-recipe-alert {
    position: relative;
}

.main-action.has-recipe-alert::after {
    content: '!';
    position: absolute;
    top: -7px;
    right: -6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ff4f5a;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.candidate-recipes-panel {
    position: absolute;
    left: 104px;
    right: 108px;
    top: 30%;
    min-height: 92px;
    max-height: 112px;
    overflow-y: auto;
    pointer-events: auto;
}

.candidate-recipes-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recipe-option {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
    align-items: center;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(168, 214, 255, 0.22);
    border-radius: 10px;
    padding: 5px 6px;
}

.recipe-meta {
    min-width: 0;
    font-size: 10px;
    color: #e8f5ff;
    line-height: 1.25;
    word-break: break-word;
}

.recipe-option button {
    border: none;
    border-radius: 9px;
    padding: 6px 8px;
    font-size: 10px;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(180deg, #5ad9ff 0%, #1f82db 100%);
}

.recipe-option button:disabled {
    opacity: 0.45;
}

.recipe-cancel-row {
    display: flex;
    justify-content: center;
    margin-top: 2px;
}

.recipe-cancel-button {
    border: 1px solid rgba(255,255,255,0.26);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 10px;
    font-weight: 900;
    color: #f2f8ff;
    background: rgba(12, 29, 78, 0.86);
}

.recipe-cancel-button:disabled {
    opacity: 0.5;
}

.center-dish-panels {
    position: absolute;
    left: 104px;
    right: 108px;
    top: 58%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    pointer-events: auto;
}

.dish-mini-panel {
    background: rgba(5, 17, 44, 0.56);
    border: 1px solid rgba(133, 196, 255, 0.22);
    border-radius: 12px;
    padding: 5px;
    min-height: 56px;
    box-sizing: border-box;
    backdrop-filter: blur(4px);
}

.dish-mini-title {
    font-size: 9px;
    font-weight: 900;
    color: #9fd5ff;
    margin-bottom: 3px;
}

.latest-dish-slot {
    display: flex;
    gap: 4px;
    align-items: stretch;
    min-height: 38px;
}

.latest-dish-empty {
    width: 100%;
    min-height: 34px;
    border: 1px dashed rgba(164, 214, 255, 0.45);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: #cfe8ff;
    text-align: center;
    padding: 4px;
    box-sizing: border-box;
}

.latest-dish-hint {
    display: none;
}

.card-row {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: center;
    min-height: 64px;
    padding-bottom: 1px;
    scrollbar-width: none;
}

.card-row::-webkit-scrollbar {
    display: none;
}

.player-hand-row {
    justify-content: flex-start;
}

.enemy-hand-row {
    justify-content: center;
}

.compact-row {
    min-height: 60px;
}

.card {
    width: 56px;
    height: 78px;
    min-width: 56px;
    border-radius: 9px;
    border: 2px solid #d97a00;
    background: #fffdf8;
    color: #3b2600;
    box-sizing: border-box;
    padding: 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.22);
}

.trap-locked-card {
    border-color: #ff7b7b !important;
    box-shadow: 0 0 0 2px rgba(255, 116, 116, 0.2), 0 2px 8px rgba(0,0,0,0.25);
}

.trap-locked-card::after {
    content: 'トラップ';
    position: absolute;
    top: 1px;
    right: 1px;
    padding: 1px 4px;
    border-radius: 8px;
    background: rgba(170, 20, 20, 0.88);
    color: #fff;
    font-size: 8px;
    font-weight: 900;
}

.card-title {
    font-size: 9px;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 2px;
}

.card-desc {
    font-size: 8px;
    line-height: 1.15;
    color: #5f5447;
}

.ingredient-card {
    background: #fff7eb;
    border-color: #df8a26;
}

.event-card {
    background: #f7edff;
    border-color: #8f5bd2;
}

.card.has-image {
    padding: 0;
    justify-content: flex-end;
    align-items: stretch;
    background: #fff6ea;
}

.card-art {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.card-name-plate {
    position: relative;
    z-index: 1;
    margin: auto 3px 3px 3px;
    padding: 2px 4px;
    border-radius: 999px;
    background: rgba(255,255,255,0.94);
    color: #412000;
    font-size: 8px;
    font-weight: 900;
    line-height: 1.1;
    box-shadow: 0 1px 4px rgba(0,0,0,0.16);
}

.card-back {
    background-image: url("../assets/images/card-back.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-color: rgba(255,255,255,0.34);
}

.card-back-label {
    color: #fff;
    font-size: 8px;
    font-weight: 900;
    background: rgba(0,0,0,0.4);
    padding: 2px 4px;
    border-radius: 8px;
}

.selected-card {
    outline: 3px solid #37d874;
    outline-offset: -3px;
}

.pack-row {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    align-items: center;
    min-height: 78px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 1px;
    scrollbar-width: none;
}

.pack-row::-webkit-scrollbar {
    display: none;
}

.pack-card {
    background: #ebf8ff;
    border-color: #4ebbe3;
}

.pack-card.has-image {
    background: #f3fbff;
}

.pack-card .card-name-plate {
    color: #08314a;
    background: rgba(240, 252, 255, 0.94);
}

.player-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 8px;
}

.player-pack-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    max-width: 210px;
    margin-bottom: 2px;
}

.player-pack-actions button {
    border: none;
    border-radius: 12px;
    background: linear-gradient(180deg, #79dcff 0%, #1c86db 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    padding: 9px 10px;
    box-shadow: 0 5px 18px rgba(0,0,0,0.28);
}

.info-tabs {
    position: absolute;
    left: 154px;
    right: 84px;
    top: calc(env(safe-area-inset-top, 0) + 8px);
    transform: none;
    bottom: auto;
    z-index: 21;
    display: flex;
    gap: 4px;
    width: auto;
    align-items: center;
    justify-content: flex-end;
    overflow-x: auto;
    pointer-events: auto;
    scrollbar-width: none;
}

.info-tabs::-webkit-scrollbar {
    display: none;
}

.tab-button {
    border: none;
    border-radius: 12px;
    background: rgba(10, 26, 70, 0.9);
    color: #dff2ff;
    border: 1px solid rgba(138, 202, 255, 0.35);
    padding: 7px 8px;
    font-size: 9px;
    font-weight: 900;
    box-shadow: 0 5px 16px rgba(0,0,0,0.24);
    white-space: nowrap;
}

.info-overlay {
    position: absolute;
    inset: 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
}

.info-overlay-panel {
    width: 100%;
    max-width: 560px;
    max-height: 78vh;
    overflow: hidden;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(7,19,55,0.97) 0%, rgba(8,25,70,0.97) 100%);
    border: 1px solid rgba(142, 201, 255, 0.32);
    box-shadow: 0 14px 40px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
}

.info-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid rgba(137, 202, 255, 0.2);
}

.info-overlay-header h2 {
    margin: 0;
    font-size: 15px;
    color: #fff2b0;
}

.info-overlay-header button {
    border: none;
    border-radius: 10px;
    background: #2e79d1;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    padding: 9px 12px;
}

.info-overlay-content {
    overflow-y: auto;
    padding: 12px;
    box-sizing: border-box;
    font-size: 12px;
    line-height: 1.45;
    color: #e6f3ff;
}

.info-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reference-item,
.info-log-entry {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(168, 214, 255, 0.14);
    border-radius: 12px;
    padding: 10px;
}

.reference-title {
    font-weight: 900;
    color: #ffd97d;
    margin-bottom: 4px;
}

.reference-pack-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reference-pack-art {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    border: 1px solid rgba(168, 214, 255, 0.36);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.reference-pack-text {
    min-width: 0;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-label {
    display: block;
    margin-top: 6px;
    margin-bottom: 3px;
    font-size: 11px;
    font-weight: 800;
    color: #d9ecff;
}

.settings-select {
    width: 100%;
    border-radius: 8px;
    border: 1px solid rgba(168, 214, 255, 0.24);
    background: rgba(11, 29, 74, 0.88);
    color: #eef7ff;
    font-size: 11px;
    font-weight: 800;
    padding: 7px 8px;
    box-sizing: border-box;
}

.settings-select:disabled {
    opacity: 0.55;
}

.settings-range-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.settings-range {
    flex: 1;
    accent-color: #6ec4ff;
}

.settings-range-value {
    min-width: 46px;
    text-align: right;
    font-size: 10px;
    font-weight: 900;
    color: #d9ecff;
}

.settings-reset-button {
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: 9px 10px;
    font-size: 11px;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(180deg, #f06b77 0%, #b94358 100%);
    box-shadow: 0 4px 14px rgba(0,0,0,0.22);
}

.settings-note,
.settings-placeholder {
    margin-top: 4px;
    font-size: 10px;
    line-height: 1.35;
    color: #b6d7ff;
}

.settings-bg-shop {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-bg-shop-title {
    font-size: 11px;
    font-weight: 900;
    color: #cde9ff;
}

.settings-bg-shop-item {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 7px;
    align-items: center;
    border: 1px solid rgba(168, 214, 255, 0.2);
    border-radius: 10px;
    padding: 6px;
    background: rgba(4, 15, 44, 0.58);
}

.settings-bg-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    border: 1px solid rgba(168, 214, 255, 0.3);
    background-color: rgba(5, 18, 52, 0.9);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.settings-bg-shop-meta {
    min-width: 0;
}

.settings-bg-shop-name {
    font-size: 11px;
    font-weight: 900;
    color: #e8f5ff;
    margin-bottom: 2px;
}

.settings-bg-shop-desc {
    font-size: 10px;
    color: #c5deef;
    line-height: 1.3;
}

.settings-bg-buy-button {
    border: none;
    border-radius: 10px;
    padding: 7px 8px;
    font-size: 10px;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(180deg, #3c9cf0 0%, #2a5ea8 100%);
}

.settings-bg-buy-button:disabled {
    background: #7f97af;
}

.info-rule-block {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(168, 214, 255, 0.14);
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 8px;
}

.info-rule-title {
    font-size: 13px;
    font-weight: 900;
    color: #ffd97d;
    margin-bottom: 6px;
}

.log-area {
    display: none;
}

.panel-box,
.side-panel,
.center-panel,
.reference-box {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(168, 214, 255, 0.14);
    color: #fff;
    border-radius: 16px;
}

.selection-panel {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 60;
    width: min(92vw, 520px);
    max-height: 80vh;
    overflow-y: auto;
    padding: 12px;
    box-sizing: border-box;
    background: linear-gradient(180deg, rgba(8,20,58,0.97) 0%, rgba(11,30,78,0.97) 100%);
    border: 1px solid rgba(140, 204, 255, 0.28);
    box-shadow: 0 18px 50px rgba(0,0,0,0.4);
    color: #eaf6ff;
    border-radius: 18px;
}

#dish-history-panel.selection-panel {
    width: min(96vw, 640px);
}

#selection-panel:not(.hidden),
#set-confirm-panel:not(.hidden),
#pack-confirm-panel:not(.hidden),
#event-confirm-panel:not(.hidden),
#set-view-panel:not(.hidden),
#ingredient-action-panel:not(.hidden),
#pile-confirm-panel:not(.hidden),
#pile-view-panel:not(.hidden),
#end-turn-confirm-panel:not(.hidden),
#dish-history-panel:not(.hidden) {
    outline: 9999px solid rgba(0,0,0,0.4);
}

.selection-panel h3 {
    margin-top: 0;
    color: #ffe490;
}

.selection-description {
    font-size: 12px;
    line-height: 1.45;
    margin-bottom: 8px;
}

.ingredient-combo-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
    margin-bottom: 8px;
}

.ingredient-combo-item {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(168, 214, 255, 0.16);
    border-radius: 10px;
    padding: 8px;
}

.ingredient-combo-title {
    font-size: 12px;
    font-weight: 900;
    color: #ffe08f;
    margin-bottom: 4px;
}

.ingredient-combo-status {
    font-size: 11px;
    line-height: 1.35;
    color: #d7ecff;
}

.condition-warning {
    display: inline-block;
    margin-top: 4px;
    color: #ffd48b;
    font-weight: 900;
}

.selection-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.selection-choice {
    min-width: 72px;
    padding: 9px 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(169, 214, 255, 0.18);
    color: #e8f4ff;
    text-align: center;
    font-size: 11px;
    font-weight: 900;
}

.selection-choice.active {
    background: rgba(69, 196, 121, 0.2);
    border-color: #4fe08f;
}

.selection-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    position: sticky;
    bottom: 0;
    background: rgba(8,20,58,0.96);
    padding-top: 8px;
}

.selection-actions button {
    border: none;
    border-radius: 10px;
    padding: 10px 12px;
    background: #2c78d1;
    color: #fff;
    font-weight: 900;
}

.selection-actions button:disabled {
    opacity: 0.45;
}

.pile-view-list,
.dish-history-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.dish-history-list {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.pile-card-item {
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 8px;
    border: 1px solid rgba(168, 214, 255, 0.16);
}

.pile-card-name {
    font-size: 12px;
    font-weight: 900;
    color: #fff0ae;
    margin-bottom: 4px;
}

.pile-card-type {
    font-size: 10px;
    color: #d3e8ff;
}

.dish-card {
    width: 100%;
    min-height: 120px;
    border-radius: 12px;
    border: 1px solid rgba(255, 216, 126, 0.4);
    background: linear-gradient(180deg, rgba(255,249,230,0.98) 0%, rgba(255,228,173,0.96) 100%);
    color: #4e2c00;
    overflow: hidden;
    position: relative;
}

.dish-history-list .dish-card {
    min-height: 170px;
}

.compact-dish-card {
    min-height: 52px;
}

.dish-card.has-dish-image {
    background: #fff8e9;
}

.dish-art {
    position: absolute;
    inset: 0;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #fff8e9;
}

.dish-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 5px;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.82) 100%);
    color: #fff;
}

.dish-title {
    font-size: 10px;
    font-weight: 900;
    line-height: 1.2;
}

.dish-title.text-only {
    color: #783f00;
    padding: 8px 8px 4px 8px;
}

.dish-points {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.9);
    color: #7a3a00;
    font-size: 9px;
    font-weight: 900;
}

.dish-required {
    font-size: 9px;
    color: #6d4e1c;
    padding: 6px 8px 8px 8px;
    line-height: 1.35;
}

.result-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.48);
    backdrop-filter: blur(3px);
    pointer-events: none;
}

.result-text {
    font-size: 38px;
    font-weight: 900;
    letter-spacing: 2px;
    text-align: center;
    white-space: pre-line;
    padding: 20px 24px;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.28);
}

.result-overlay.win .result-text {
    color: #fff8d6;
    background: linear-gradient(180deg, #ffcc4d 0%, #d88a00 100%);
    border: 3px solid #fff1a8;
}

.result-overlay.lose .result-text {
    color: #fff;
    background: linear-gradient(180deg, #7f8ea3 0%, #3d4b5f 100%);
    border: 3px solid #cfd8e3;
}

.spotlight-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.42);
    backdrop-filter: blur(2px);
    pointer-events: none;
}

.spotlight-card-shell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.spotlight-badge {
    color: #fff6cf;
    background: linear-gradient(180deg, #ffb42f 0%, #d47400 100%);
    border: 2px solid #ffe7a3;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 15px;
    font-weight: 900;
}

.spotlight-card {
    width: 220px;
    min-height: 318px;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(180deg, #fff8ea 0%, #ffe0a6 100%);
    border: 3px solid #efb44f;
    box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}

.spotlight-card.event {
    border-color: #9a6be3;
    background: linear-gradient(180deg, #f7f0ff 0%, #ead8ff 100%);
}

.spotlight-card.pack {
    border-color: #4cc6f0;
    background: linear-gradient(180deg, #eefbff 0%, #d7f3ff 100%);
}

.spotlight-overlay.spotlight-skill {
    background: rgba(10, 6, 2, 0.62);
    backdrop-filter: blur(2px) saturate(1.15);
}

.spotlight-overlay.spotlight-battle-mode {
    background: radial-gradient(circle at center, rgba(255, 203, 80, 0.26) 0%, rgba(16, 8, 2, 0.9) 70%);
    backdrop-filter: blur(2px) saturate(1.26);
    animation: mobile-battle-mode-spotlight-pulse 1s ease-in-out infinite alternate;
}

.spotlight-overlay.spotlight-battle-mode::before,
.spotlight-overlay.spotlight-battle-mode::after {
    content: '';
    position: absolute;
    inset: -22%;
    pointer-events: none;
}

.spotlight-overlay.spotlight-battle-mode::before {
    background: conic-gradient(from 0deg, rgba(255, 240, 180, 0.12), rgba(255, 160, 28, 0.34), rgba(255, 240, 180, 0.12));
    filter: blur(14px);
    animation: mobile-battle-mode-spotlight-spin 2.5s linear infinite;
}

.spotlight-overlay.spotlight-battle-mode::after {
    background: radial-gradient(circle, rgba(255, 245, 210, 0.2) 0%, rgba(255, 204, 110, 0.08) 40%, rgba(0, 0, 0, 0) 68%);
}

.spotlight-overlay.spotlight-skill .spotlight-card-shell {
    animation: mobile-skill-cutin-pop 0.26s ease-out;
}

.spotlight-overlay.spotlight-battle-mode .spotlight-card-shell {
    animation: mobile-battle-mode-cutin-pop 0.4s cubic-bezier(.2,.88,.18,1.12);
}

.spotlight-card.skill {
    width: min(94vw, 520px);
    min-height: 0;
    border-color: #ffd878;
    background: radial-gradient(circle at 50% 20%, #fff0c4 0%, #e28600 72%, #8f4300 100%);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.48);
}

.spotlight-card.battle-mode {
    width: min(95vw, 560px);
    min-height: 0;
    border-color: #fff0b0;
    background: radial-gradient(circle at 50% 14%, #fff8dd 0%, #ffc957 38%, #d27700 72%, #613400 100%);
    box-shadow: 0 22px 54px rgba(0, 0, 0, 0.56), 0 0 36px rgba(255, 193, 84, 0.42);
}

.spotlight-card.battle-mode-text {
    width: min(92vw, 520px);
    min-height: 0;
    border-color: #ffe9a9;
    background: linear-gradient(180deg, #fff3d0 0%, #e79a2e 100%);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.44), 0 0 18px rgba(255, 204, 111, 0.3);
}

.spotlight-card.battle-mode::before {
    content: '';
    position: absolute;
    inset: -36% -68%;
    pointer-events: none;
    background: linear-gradient(118deg, rgba(255, 255, 255, 0) 32%, rgba(255, 255, 255, 0.84) 50%, rgba(255, 255, 255, 0) 68%);
    transform: translateX(-74%) rotate(11deg);
    animation: mobile-battle-mode-cutin-halo 1.45s ease-out 1;
}

.spotlight-card.battle-mode::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 0 24px rgba(255, 249, 220, 0.36);
}

.spotlight-card.skill::before {
    content: '';
    position: absolute;
    inset: -38% -72%;
    pointer-events: none;
    background: linear-gradient(115deg, rgba(255, 255, 255, 0) 35%, rgba(255, 245, 208, 0.8) 50%, rgba(255, 255, 255, 0) 65%);
    transform: translateX(-72%) rotate(11deg);
    animation: mobile-skill-cutin-sheen 1.8s ease-out 1;
}

.spotlight-card.skill .spotlight-art {
    height: clamp(220px, 50vh, 430px);
    background-size: cover;
    background-position: center top;
    background-color: rgba(35, 16, 0, 0.58);
    filter: saturate(1.1) contrast(1.08);
}

.spotlight-card.skill .spotlight-name {
    font-size: clamp(22px, 6.2vw, 34px);
    letter-spacing: 1px;
    color: #fff5d0;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.68);
}

.spotlight-card.skill .spotlight-sub {
    font-size: clamp(12px, 3.7vw, 17px);
    color: #ffe8ad;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.spotlight-card.battle-mode .spotlight-art {
    height: clamp(230px, 56vh, 460px);
    background-size: cover;
    background-position: center top;
    background-color: rgba(45, 20, 0, 0.5);
    filter: saturate(1.18) contrast(1.1) brightness(1.06);
    animation: mobile-battle-mode-art-pulse 1.15s ease-in-out infinite alternate;
}

.spotlight-card.battle-mode .spotlight-name {
    font-size: clamp(22px, 6.6vw, 38px);
    letter-spacing: 1px;
    color: #fff8dc;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.72), 0 0 14px rgba(255, 216, 114, 0.46);
}

.spotlight-card.battle-mode .spotlight-sub {
    font-size: clamp(12px, 4vw, 19px);
    color: #fff0c2;
    text-shadow: 0 2px 9px rgba(0, 0, 0, 0.66);
}

.spotlight-card.battle-mode-text .spotlight-art,
.spotlight-card.battle-mode-text .spotlight-sub {
    display: none;
}

.spotlight-card.battle-mode-text .spotlight-name {
    padding: clamp(15px, 5.2vw, 24px) clamp(14px, 5.4vw, 26px);
    font-size: clamp(24px, 8.2vw, 42px);
    letter-spacing: 1px;
    color: #fff9e8;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.72), 0 0 12px rgba(255, 210, 115, 0.5);
}

@keyframes mobile-skill-cutin-pop {
    0% {
        opacity: 0;
        transform: translateX(14px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes mobile-skill-cutin-sheen {
    0% {
        opacity: 0;
        transform: translateX(-72%) rotate(11deg);
    }
    25% {
        opacity: 0.95;
    }
    100% {
        opacity: 0;
        transform: translateX(74%) rotate(11deg);
    }
}

@keyframes mobile-battle-mode-spotlight-pulse {
    0% { opacity: 0.95; }
    100% { opacity: 1; }
}

@keyframes mobile-battle-mode-spotlight-spin {
    0% { transform: rotate(0deg) scale(1); }
    100% { transform: rotate(360deg) scale(1.05); }
}

@keyframes mobile-battle-mode-cutin-pop {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(18px);
    }
    62% {
        opacity: 1;
        transform: scale(1.04) translateY(-3px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes mobile-battle-mode-cutin-halo {
    0% {
        opacity: 0;
        transform: translateX(-76%) rotate(11deg);
    }
    18% {
        opacity: 0.95;
    }
    100% {
        opacity: 0;
        transform: translateX(76%) rotate(11deg);
    }
}

@keyframes mobile-battle-mode-art-pulse {
    0% { filter: saturate(1.12) contrast(1.06) brightness(1.02); }
    100% { filter: saturate(1.24) contrast(1.12) brightness(1.11); }
}

.spotlight-art {
    width: 100%;
    height: 246px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgba(255,255,255,0.55);
}

.spotlight-name {
    font-size: 20px;
    font-weight: 900;
    text-align: center;
    color: #6e3600;
    padding: 10px 12px 4px 12px;
}

.spotlight-sub {
    font-size: 12px;
    text-align: center;
    color: #6a5944;
    padding: 0 12px 14px 12px;
    line-height: 1.35;
}

.hidden-reference {
    display: none !important;
}

.start-overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(4px);
    padding: 14px;
    box-sizing: border-box;
}

.start-panel {
    width: min(92vw, 420px);
    max-height: min(88vh, 760px);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(8,20,58,0.97) 0%, rgba(11,30,78,0.97) 100%);
    border: 1px solid rgba(140, 204, 255, 0.28);
    box-shadow: 0 20px 56px rgba(0,0,0,0.45);
    padding: 16px 16px 20px;
    box-sizing: border-box;
    text-align: center;
    overflow-y: auto;
    color: #eaf6ff;
}

.start-stage {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.start-setup-step {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#start-menu-stage {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    padding: 4px;
}

.start-menu-floating-bg {
    position: absolute;
    inset: -10px;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.start-menu-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-floating-card {
    position: absolute;
    width: 96px;
    height: 136px;
    transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(var(--scale, 1));
    border-radius: 10px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgba(7, 21, 61, 0.72);
    border: 1px solid rgba(255,255,255,0.28);
    box-shadow: 0 8px 22px rgba(0,0,0,0.28);
    opacity: 0;
    filter: saturate(1.08);
    animation: start-menu-card-fade var(--duration, 6.2s) ease-in-out 1 both;
    animation-delay: var(--delay, 0s);
}

.menu-floating-card.rare-glow {
    border-color: rgba(255, 238, 170, 0.95);
    box-shadow:
        0 0 0 1px rgba(255, 246, 200, 0.62),
        0 0 10px rgba(255, 223, 130, 0.48),
        0 0 18px rgba(255, 201, 88, 0.35);
    filter: saturate(1.14) brightness(1.04);
    animation: start-menu-card-fade var(--duration, 6.2s) ease-in-out 1 both;
}

@keyframes start-menu-card-fade {
    0% {
        transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(calc(var(--scale, 1) * 0.96));
        opacity: 0;
    }
    8% {
        opacity: 0.84;
    }
    88% {
        opacity: 0.84;
    }
    100% {
        transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(calc(var(--scale, 1) * 1.01));
        opacity: 0;
    }
}

@keyframes start-menu-card-glow {
    0%, 100% {
        filter: saturate(1.18) brightness(1.06);
    }
    50% {
        filter: saturate(1.35) brightness(1.22);
    }
}

.start-title {
    margin: 0;
    font-size: 24px;
    color: #ffe490;
}

.start-subtitle {
    margin: 8px 0 14px 0;
    font-size: 12px;
    color: #d8ecff;
}

.start-char-select {
    display: grid;
    grid-template-columns: repeat(2, minmax(112px, 132px));
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}

.start-char-button,
.start-main-button,
.start-turn-card {
    border: none;
    border-radius: 12px;
    font-weight: 900;
    color: #fff;
}

.start-char-button {
    width: 100%;
    padding: 8px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(168, 214, 255, 0.22);
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.start-char-button.active {
    background: linear-gradient(180deg, #42c8ff 0%, #1d6acb 100%);
}

.start-char-portrait {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background-repeat: no-repeat;
    background-position: center;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.32);
}

.start-char-name {
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.2px;
}

.start-main-button {
    width: 100%;
    padding: 11px 10px;
    background: linear-gradient(180deg, #ffc857 0%, #cf7d12 100%);
    font-size: 13px;
    margin-bottom: 12px;
}

.start-menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.start-menu-buttons .start-main-button {
    margin-bottom: 0;
}

.start-menu-button {
    width: 100%;
    border: 1px solid rgba(168, 214, 255, 0.26);
    border-radius: 12px;
    padding: 10px 10px;
    font-size: 12px;
    font-weight: 900;
    color: #e8f5ff;
    background: rgba(255,255,255,0.16);
    backdrop-filter: blur(2px);
}

.start-menu-button.home-link {
    border-color: rgba(255, 208, 126, 0.45);
    color: #fff0cb;
}

.start-menu-message {
    min-height: 18px;
    margin: 2px 0 0 0;
    font-size: 11px;
    color: #ffd784;
    font-weight: 800;
}

.start-section-title {
    margin: 0;
    font-size: 20px;
    color: #ffe490;
}

.start-setup-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.start-setup-actions .start-main-button {
    margin-bottom: 0;
}

.start-sub-button {
    width: 100%;
    border: 1px solid rgba(168, 214, 255, 0.26);
    border-radius: 12px;
    padding: 11px 10px;
    font-size: 12px;
    font-weight: 900;
    color: #e8f5ff;
    background: rgba(255,255,255,0.1);
}

.start-sub-button.wide {
    margin-top: 4px;
}

.start-stage-footer {
    position: sticky;
    bottom: -6px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 8px;
    background: linear-gradient(180deg, rgba(8,20,58,0) 0%, rgba(8,20,58,0.97) 24%);
}

.start-user-form {
    text-align: left;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(168, 214, 255, 0.2);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.start-skill-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-height: none;
    overflow: visible;
    padding-right: 0;
}

.start-skill-tile {
    border: 1px solid rgba(168, 214, 255, 0.24);
    border-radius: 12px;
    background: rgba(7, 20, 55, 0.66);
    padding: 8px;
    min-height: 72px;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    color: #eaf6ff;
}

.start-skill-tile.active {
    border-color: rgba(255, 208, 126, 0.68);
    box-shadow: 0 0 0 1px rgba(255, 208, 126, 0.45) inset;
    background: linear-gradient(180deg, rgba(255, 214, 137, 0.26) 0%, rgba(31, 80, 148, 0.65) 100%);
}

.start-skill-tile-name {
    font-size: 12px;
    font-weight: 900;
    color: #ffe8a8;
    line-height: 1.3;
}

.start-skill-tile-uses {
    font-size: 11px;
    font-weight: 800;
    color: #9fd7ff;
}

.start-skill-detail {
    border-radius: 12px;
    border: 1px solid rgba(168, 214, 255, 0.2);
    background: rgba(4, 15, 44, 0.58);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.start-skill-detail-name {
    font-size: 12px;
    font-weight: 900;
    color: #ffe9ac;
}

.start-skill-detail-row {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 8px;
    font-size: 11px;
}

.start-skill-detail-row span {
    color: #9dcdf9;
    font-weight: 900;
}

.start-skill-detail-row strong {
    color: #e4f2ff;
    font-weight: 700;
    line-height: 1.45;
}

.start-skill-rules-list {
    display: grid;
    gap: 8px;
}

.start-skill-rule-item {
    border: 1px solid rgba(168, 214, 255, 0.24);
    border-radius: 10px;
    background: rgba(7, 20, 55, 0.66);
    padding: 8px;
    text-align: left;
    font-size: 11px;
    line-height: 1.45;
    color: #dff2ff;
}

.start-skill-rule-name {
    color: #ffe8a8;
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 4px;
}

.start-field-label {
    font-size: 12px;
    font-weight: 900;
    color: #ffe9a9;
}

.start-text-input,
.start-select-input {
    width: 100%;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid rgba(168, 214, 255, 0.35);
    background: rgba(5, 18, 52, 0.72);
    color: #eef8ff;
    padding: 10px;
    font-size: 13px;
}

.start-text-input::placeholder {
    color: rgba(217, 237, 255, 0.68);
}

.start-user-stats {
    margin-top: 4px;
    border-radius: 10px;
    border: 1px solid rgba(168, 214, 255, 0.2);
    background: rgba(4, 15, 44, 0.58);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.start-user-recent-wrap {
    margin-top: 4px;
}

.start-user-recent-list {
    margin-top: 2px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.start-user-recent-item {
    border: 1px solid rgba(168, 214, 255, 0.2);
    border-radius: 8px;
    background: rgba(4, 15, 44, 0.58);
    padding: 6px 8px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    color: #dcefff;
}

.start-user-recent-item strong {
    color: #ffe490;
}

.start-user-recent-empty {
    border: 1px solid rgba(168, 214, 255, 0.2);
    border-radius: 8px;
    background: rgba(4, 15, 44, 0.58);
    padding: 8px;
    font-size: 11px;
    color: #c9e2fb;
}

.start-user-stat-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: #dcefff;
}

.start-user-stat-row strong {
    color: #ffe490;
    font-size: 13px;
}

.start-bg-shop-wrap {
    margin-top: 4px;
}

.start-bg-shop {
    margin-top: 2px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(34vh, 240px);
    overflow-y: auto;
    padding-right: 2px;
}

.start-bg-shop-item {
    display: grid;
    grid-template-columns: 68px 1fr auto;
    gap: 7px;
    align-items: center;
    border-radius: 10px;
    border: 1px solid rgba(168, 214, 255, 0.24);
    background: rgba(4, 15, 44, 0.58);
    padding: 6px;
}

.start-bg-shop-art {
    width: 68px;
    height: 68px;
    border-radius: 9px;
    border: 1px solid rgba(204, 231, 255, 0.34);
    background-color: rgba(7, 21, 61, 0.72);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.start-bg-shop-art.default-art {
    background-image: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.02) 100%);
}

.start-bg-shop-meta {
    min-width: 0;
}

.start-bg-shop-name {
    font-size: 11px;
    font-weight: 900;
    color: #ffeab0;
    margin-bottom: 2px;
}

.start-bg-shop-desc {
    font-size: 10px;
    line-height: 1.32;
    color: #d7ebff;
    margin-bottom: 2px;
}

.start-bg-shop-cost {
    font-size: 10px;
    font-weight: 900;
    color: #89d2ff;
}

.start-bg-shop-button {
    border: 1px solid rgba(160, 218, 255, 0.34);
    border-radius: 10px;
    background: rgba(63, 164, 255, 0.26);
    color: #eaf6ff;
    padding: 7px 8px;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

.start-bg-shop-button.active {
    background: rgba(255, 201, 112, 0.28);
    border-color: rgba(255, 217, 148, 0.52);
    color: #ffe9b1;
}

.start-bg-shop-button.locked {
    background: rgba(107, 134, 160, 0.24);
    color: rgba(227, 238, 248, 0.82);
}

.start-bg-shop-button:disabled {
    opacity: 0.72;
}

.start-rules-scroll {
    text-align: left;
    max-height: min(48vh, 360px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 3px;
}

.start-rule-box {
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(168, 214, 255, 0.2);
    padding: 10px;
}

.start-rule-box h3 {
    margin: 0 0 4px 0;
    font-size: 12px;
    color: #ffe08f;
}

.start-rule-box p {
    margin: 0;
    font-size: 11px;
    line-height: 1.45;
    color: #dff2ff;
}

.start-gallery-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 6px;
}

.start-gallery-filter {
    border: 1px solid rgba(168, 214, 255, 0.26);
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    color: #e4f3ff;
    padding: 8px 9px;
    font-size: 11px;
    font-weight: 900;
}

.start-gallery-filter.active {
    background: linear-gradient(180deg, #79dcff 0%, #1c86db 100%);
    border-color: rgba(200, 238, 255, 0.72);
}

.start-gallery-list {
    max-height: min(60vh, 520px);
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    text-align: left;
    padding-right: 2px;
}

.start-gallery-list.character-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.start-gallery-list.card-grid {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.start-gallery-card {
    margin: 0;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(168, 214, 255, 0.2);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.start-gallery-art {
    width: 100%;
    min-height: 156px;
    height: 156px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.2);
    background-color: rgba(5, 18, 52, 0.9);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.start-gallery-art.character-art {
    min-height: 176px;
    height: 176px;
    aspect-ratio: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(8, 24, 65, 0.6);
}

.start-gallery-art.ingredient-art {
    width: min(100%, 132px);
    margin: 0;
    min-height: 156px;
    height: 156px;
    background-size: contain;
    background-color: rgba(5, 18, 52, 0.9);
    margin-left: auto;
    margin-right: auto;
}

.start-gallery-art.start-gallery-card-art {
    width: min(100%, 132px);
    margin: 0;
    min-height: 156px;
    height: 156px;
    background-size: contain;
    background-color: rgba(5, 18, 52, 0.9);
    margin-left: auto;
    margin-right: auto;
}

.start-gallery-art.character-art .start-char-portrait {
    width: min(100%, 168px);
    height: min(100%, 168px);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.start-gallery-title {
    font-size: 14px;
    font-weight: 900;
    color: #fff3be;
}

.start-gallery-meta {
    font-size: 11px;
    color: #d9edff;
    line-height: 1.4;
}

.start-gallery-empty {
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(168, 214, 255, 0.2);
    padding: 12px;
    font-size: 12px;
    color: #d8ecff;
    text-align: center;
}

.story-hud-panel {
    position: fixed;
    top: 56px;
    right: 8px;
    z-index: 115;
    width: min(270px, 86vw);
    border-radius: 12px;
    border: 1px solid rgba(176, 223, 255, 0.38);
    background: linear-gradient(180deg, rgba(8, 24, 66, 0.94) 0%, rgba(7, 19, 56, 0.96) 100%);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
    padding: 9px;
    color: #e8f6ff;
}

.story-hud-title {
    font-size: 13px;
    font-weight: 900;
    color: #ffe49b;
    margin-bottom: 4px;
}

.story-hud-note {
    font-size: 10px;
    line-height: 1.45;
    color: #cfe8ff;
    margin-bottom: 6px;
}

.story-hud-objectives {
    display: grid;
    gap: 5px;
}

.story-hud-item {
    border-radius: 8px;
    border: 1px solid rgba(165, 216, 255, 0.26);
    background: rgba(255, 255, 255, 0.07);
    padding: 6px 8px;
    font-size: 10px;
    line-height: 1.4;
}

.story-hud-item.done {
    border-color: rgba(255, 218, 128, 0.58);
    background: linear-gradient(180deg, rgba(255, 215, 126, 0.22) 0%, rgba(55, 153, 235, 0.2) 100%);
    color: #ffefc0;
}

.story-episode-list {
    display: grid;
    gap: 8px;
    max-height: min(52vh, 390px);
    overflow-y: auto;
    padding-right: 2px;
}

.story-episode-card {
    border-radius: 12px;
    border: 1px solid rgba(168, 214, 255, 0.24);
    background: rgba(4, 15, 44, 0.58);
    padding: 9px;
    display: grid;
    gap: 6px;
    text-align: left;
}

.story-episode-card.locked {
    opacity: 0.7;
}

.story-episode-title {
    font-size: 12px;
    font-weight: 900;
    color: #ffeab0;
}

.story-episode-summary {
    font-size: 10px;
    line-height: 1.45;
    color: #d7ebff;
}

.story-episode-meta {
    font-size: 10px;
    color: #90ccff;
    font-weight: 800;
}

.story-episode-start {
    border: 1px solid rgba(170, 228, 255, 0.34);
    border-radius: 10px;
    background: rgba(65, 165, 255, 0.24);
    color: #eaf6ff;
    padding: 7px 9px;
    font-size: 10px;
    font-weight: 900;
    justify-self: start;
}

.story-episode-start:disabled {
    opacity: 0.7;
}

.story-dialogue-panel {
    border-radius: 12px;
    border: 1px solid rgba(168, 214, 255, 0.26);
    background: linear-gradient(180deg, rgba(8, 24, 64, 0.86) 0%, rgba(5, 16, 45, 0.92) 100%);
    padding: 9px;
    display: grid;
    gap: 8px;
}

.story-dialogue-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.story-speaker-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    border: 1px solid rgba(214, 240, 255, 0.38);
    background-color: rgba(8, 25, 62, 0.82);
    background-repeat: no-repeat;
    background-size: 360% auto;
    background-position: calc(0% - 14px) 32%;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}

.story-speaker-meta {
    min-width: 0;
}

.story-speaker-name {
    font-size: 12px;
    font-weight: 900;
    color: #ffe8a8;
}

.story-line-progress {
    margin-top: 1px;
    font-size: 10px;
    color: #9fd7ff;
    font-weight: 800;
}

.story-dialogue-text {
    border-radius: 10px;
    border: 1px solid rgba(168, 214, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    padding: 9px;
    font-size: 11px;
    line-height: 1.55;
    color: #ecf8ff;
    text-align: left;
    min-height: 74px;
}

.story-battle-guide {
    border-radius: 12px;
    border: 1px solid rgba(168, 214, 255, 0.22);
    background: rgba(255, 255, 255, 0.06);
    padding: 9px;
    display: grid;
    gap: 8px;
    text-align: left;
}

.story-battle-guide-title {
    font-size: 11px;
    font-weight: 900;
    color: #ffe9ad;
}

.story-objective-note {
    font-size: 10px;
    color: #d8ecff;
    line-height: 1.45;
}

.story-objective-list {
    display: grid;
    gap: 6px;
}

.story-objective-item {
    border-radius: 8px;
    border: 1px solid rgba(168, 214, 255, 0.22);
    background: rgba(4, 15, 44, 0.5);
    padding: 7px 8px;
    font-size: 10px;
    line-height: 1.4;
    color: #dff2ff;
}

.story-objective-item.done {
    border-color: rgba(255, 218, 128, 0.58);
    background: linear-gradient(180deg, rgba(255, 215, 126, 0.22) 0%, rgba(55, 153, 235, 0.2) 100%);
    color: #ffefc0;
}

/* ===== usability patch: 2026-04-12 ===== */
#player-hand-mixed,
#cpu-hand-mixed,
#player-set,
#cpu-set,
#player-packs,
#cpu-packs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

#player-hand-mixed .card,
#cpu-hand-mixed .card,
#player-set .card,
#cpu-set .card,
#player-packs .card,
#cpu-packs .card {
    flex: 0 0 auto;
}

.card-row.is-drag-scrolling,
.pack-row.is-drag-scrolling {
    cursor: grabbing;
    user-select: none;
}

.candidate-recipes-panel {
    max-height: min(25vh, 132px);
    overflow-y: auto;
    padding-bottom: 4px;
}

.candidate-recipes-panel.expanded {
    top: 21%;
    max-height: min(46vh, 320px);
}

.candidate-recipes-panel .recipe-cancel-row {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding-top: 4px;
    background: linear-gradient(180deg, rgba(5, 17, 44, 0) 0%, rgba(5, 17, 44, 0.9) 38%, rgba(5, 17, 44, 0.98) 100%);
}

.start-turn-stage.hidden {
    display: none;
}

.start-turn-message {
    margin: 0 0 10px 0;
    font-size: 12px;
}

.start-turn-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.start-turn-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 88px;
    padding: 8px 8px;
    border: 2px solid rgba(228, 239, 255, 0.4);
    background-image:
        linear-gradient(180deg, rgba(2, 13, 40, 0.18) 0%, rgba(2, 8, 25, 0.58) 100%),
        url("../assets/images/card-back.png");
    background-size: cover;
    background-position: center;
    box-shadow: 0 6px 16px rgba(0,0,0,0.34);
    text-shadow: 0 1px 3px rgba(0,0,0,0.85);
    font-size: 14px;
    line-height: 1.35;
}

.start-turn-card.revealed {
    background-image:
        linear-gradient(180deg, rgba(54, 186, 255, 0.42) 0%, rgba(28, 102, 200, 0.58) 100%),
        url("../assets/images/card-back.png");
    border-color: rgba(196, 233, 255, 0.82);
}

.start-turn-card.chosen {
    outline: 3px solid #ffd873;
    outline-offset: -3px;
}

.start-battle-message {
    min-height: 18px;
    margin-top: 10px;
    color: #ffe490;
    font-weight: 900;
}

@media (min-width: 700px) {
    #game-container.mobile-field-ui {
        max-width: 430px;
        margin: 0 auto;
        border-left: 1px solid rgba(255,255,255,0.08);
        border-right: 1px solid rgba(255,255,255,0.08);
    }

    .duel-field {
        padding-left: 10px;
        padding-right: 10px;
    }
}

