html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    font-family: sans-serif;
    background: #fff8ef;
    color: #333;
    overflow-x: hidden;
}

#game-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px;
    box-sizing: border-box;
    position: relative;
    isolation: isolate;
    --bg-design-image: none;
    --bg-design-opacity: 0.3;
    --web-fit-scale: 1;
}

body.web-battle-fixed {
    overflow: hidden;
}

body.web-battle-fixed #game-container {
    width: min(100vw, 1400px);
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    transform-origin: top center;
    transform: scale(var(--web-fit-scale, 1));
}

.top-bar {
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.title-block h1 {
    margin: 0 0 6px 0;
    color: #d76b00;
    font-size: 28px;
}

#turn-indicator,
#phase-indicator,
#cpu-status {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 4px;
}

#cpu-status {
    color: #b23a48;
    min-height: 18px;
}

.header-actions {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.discard-banner {
    position: absolute;
    left: 50%;
    top: 76px;
    transform: translateX(-50%);
    z-index: 3400;
    width: min(92vw, 560px);
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(255, 246, 220, 0.96);
    border: 3px solid #e2ad35;
    color: #8a4c00;
    text-align: center;
    font-size: clamp(15px, 1.6vw, 22px);
    font-weight: 900;
    line-height: 1.45;
    letter-spacing: 0.2px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
    pointer-events: none;
    animation: none;
}

@keyframes discardBannerPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.02);
        box-shadow: 0 14px 42px rgba(0, 0, 0, 0.42);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
    }
}

body.web-battle-fixed .discard-banner {
    top: 84px;
    width: min(90vw, 620px);
}

.hidden {
    display: none !important;
}

.result-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
    pointer-events: none;
}

.result-text {
    font-size: 72px;
    font-weight: 900;
    letter-spacing: 4px;
    padding: 28px 48px;
    border-radius: 20px;
    text-shadow: 0 4px 12px rgba(0,0,0,0.45);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.result-overlay.win .result-text {
    color: #fff8d6;
    background: linear-gradient(180deg, #ffcc4d 0%, #d88a00 100%);
    border: 4px solid #fff1a8;
}

.result-overlay.lose .result-text {
    color: #ffffff;
    background: linear-gradient(180deg, #7f8ea3 0%, #3d4b5f 100%);
    border: 4px solid #cfd8e3;
}

.spotlight-overlay {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.38);
    backdrop-filter: blur(2px);
    pointer-events: none;
}

.spotlight-card-shell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: spotlightPop 0.22s ease;
}

@keyframes spotlightPop {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.spotlight-badge {
    color: #fff6cf;
    background: linear-gradient(180deg, #ffb42f 0%, #d47400 100%);
    border: 3px solid #ffe7a3;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 1px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.22);
}

.spotlight-card {
    width: 240px;
    min-height: 350px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(180deg, #fff8ea 0%, #ffe0a6 100%);
    border: 4px 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.recipe {
    border-color: #efb44f;
    background: linear-gradient(180deg, #fff8ea 0%, #ffe0a6 100%);
}

.spotlight-overlay.spotlight-skill {
    background: rgba(12, 7, 2, 0.6);
    backdrop-filter: blur(2px) saturate(1.15);
}

.spotlight-overlay.spotlight-battle-mode {
    background: radial-gradient(circle at center, rgba(255, 206, 82, 0.28) 0%, rgba(18, 8, 2, 0.88) 72%);
    backdrop-filter: blur(3px) saturate(1.3);
    animation: battleModeSpotlightPulse 0.9s ease-in-out infinite alternate;
}

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

.spotlight-overlay.spotlight-battle-mode::before {
    background: conic-gradient(from 0deg, rgba(255, 236, 174, 0.15), rgba(255, 153, 0, 0.38), rgba(255, 236, 174, 0.15));
    filter: blur(18px);
    animation: battleModeSpotlightSpark 2.3s linear infinite;
}

.spotlight-overlay.spotlight-battle-mode::after {
    background: radial-gradient(circle, rgba(255, 244, 206, 0.2) 0%, rgba(255, 208, 121, 0.08) 36%, rgba(0, 0, 0, 0) 66%);
}

.spotlight-overlay.spotlight-skill .spotlight-card-shell {
    animation: skillCutinPop 0.28s ease-out;
}

.spotlight-overlay.spotlight-battle-mode .spotlight-card-shell {
    animation: battleModeCutinPop 0.42s cubic-bezier(.2,.88,.18,1.12);
}

.spotlight-card.skill {
    width: min(92vw, 960px);
    min-height: 0;
    border-color: #ffd878;
    background: radial-gradient(circle at 50% 20%, #fff0c4 0%, #e28600 72%, #8f4300 100%);
    box-shadow: 0 22px 58px rgba(0, 0, 0, 0.46);
}

.spotlight-card.battle-mode {
    width: min(94vw, 1020px);
    min-height: 0;
    border-color: #fff0b0;
    background: radial-gradient(circle at 50% 14%, #fff8dd 0%, #ffc957 38%, #d27700 72%, #613400 100%);
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.56), 0 0 46px rgba(255, 191, 83, 0.46);
}

.spotlight-card.battle-mode-text {
    width: min(88vw, 880px);
    min-height: 0;
    border-color: #ffe9a9;
    background: linear-gradient(180deg, #fff3d0 0%, #e79a2e 100%);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42), 0 0 24px rgba(255, 204, 111, 0.35);
}

.spotlight-card.battle-mode::before {
    content: '';
    position: absolute;
    inset: -34% -62%;
    pointer-events: none;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0) 28%, rgba(255, 255, 255, 0.88) 50%, rgba(255, 255, 255, 0) 72%);
    transform: translateX(-72%) rotate(10deg);
    animation: battleModeCutinHalo 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 32px rgba(255, 250, 220, 0.42);
}

.spotlight-card.skill::before {
    content: '';
    position: absolute;
    inset: -32% -58%;
    pointer-events: none;
    background: linear-gradient(115deg, rgba(255, 255, 255, 0) 35%, rgba(255, 245, 208, 0.82) 50%, rgba(255, 255, 255, 0) 65%);
    transform: translateX(-65%) rotate(10deg);
    animation: skillCutinSheen 1.8s ease-out 1;
}

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

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

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

.spotlight-card.battle-mode .spotlight-art {
    height: clamp(240px, 60vh, 620px);
    background-size: cover;
    background-position: center top;
    background-color: rgba(45, 20, 0, 0.5);
    filter: saturate(1.2) contrast(1.1) brightness(1.07);
    animation: battleModeArtPulse 1.1s ease-in-out infinite alternate;
}

.spotlight-card.battle-mode .spotlight-name {
    font-size: clamp(26px, 3.8vw, 50px);
    letter-spacing: 1.5px;
    color: #fff8dc;
    text-shadow: 0 4px 14px rgba(0, 0, 0, 0.76), 0 0 18px rgba(255, 217, 120, 0.5);
}

.spotlight-card.battle-mode .spotlight-sub {
    font-size: clamp(14px, 1.65vw, 24px);
    color: #fff0c2;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.68);
}

.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(18px, 2.6vw, 28px) clamp(18px, 3.2vw, 42px);
    font-size: clamp(30px, 5.2vw, 58px);
    letter-spacing: 1.4px;
    color: #fff9e8;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.72), 0 0 14px rgba(255, 210, 115, 0.55);
}

@keyframes skillCutinPop {
    0% {
        opacity: 0;
        transform: translateX(18px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes skillCutinSheen {
    0% {
        opacity: 0;
        transform: translateX(-68%) rotate(10deg);
    }
    25% {
        opacity: 0.95;
    }
    100% {
        opacity: 0;
        transform: translateX(66%) rotate(10deg);
    }
}

@keyframes battleModeSpotlightPulse {
    0% { opacity: 0.95; }
    100% { opacity: 1; }
}

@keyframes battleModeSpotlightSpark {
    0% { transform: rotate(0deg) scale(1); }
    100% { transform: rotate(360deg) scale(1.06); }
}

@keyframes battleModeCutinPop {
    0% {
        opacity: 0;
        transform: scale(0.88) translateY(20px);
    }
    62% {
        opacity: 1;
        transform: scale(1.04) translateY(-4px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes battleModeCutinHalo {
    0% {
        opacity: 0;
        transform: translateX(-78%) rotate(10deg);
    }
    18% {
        opacity: 0.95;
    }
    100% {
        opacity: 0;
        transform: translateX(78%) rotate(10deg);
    }
}

@keyframes battleModeArtPulse {
    0% { filter: saturate(1.14) contrast(1.08) brightness(1.02); }
    100% { filter: saturate(1.26) contrast(1.14) brightness(1.12); }
}

.spotlight-art {
    width: 100%;
    height: 280px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgba(255,255,255,0.55);
}

.spotlight-name {
    font-size: 22px;
    font-weight: 900;
    text-align: center;
    color: #6e3600;
    padding: 10px 12px 4px 12px;
}

.spotlight-sub {
    font-size: 13px;
    text-align: center;
    color: #6a5944;
    padding: 0 12px 14px 12px;
    line-height: 1.35;
}

.battle-layout {
    display: grid;
    grid-template-columns: 1fr 480px 1fr;
    gap: 10px;
    align-items: start;
}

.side-panel,
.center-panel,
.reference-box,
.panel-box {
    background: #fff3dd;
    border: 2px solid #efc27d;
    border-radius: 12px;
    box-sizing: border-box;
}

.side-panel,
.center-panel {
    padding: 8px;
}

.side-panel h2,
.center-panel h2,
.reference-box h2 {
    margin: 0 0 6px 0;
    color: #9a4c00;
    font-size: 18px;
}

.character-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    background: rgba(255,255,255,0.55);
    border: 2px solid #efc27d;
    border-radius: 12px;
    padding: 8px;
    min-height: 108px;
}

.character-icon {
    width: 96px;
    height: 96px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-color: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    flex-shrink: 0;
}

.character-icon.battle-mode-chef {
    position: relative;
    overflow: hidden;
    border-radius: 50%;
    border: 1.5px 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.35), 0 2px 8px 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 battleModeIconGlow {
    0% {
        transform: scale(1);
        filter: saturate(1.1) contrast(1.05) brightness(1.03)
            drop-shadow(0 0 4px rgba(255, 216, 130, 0.62))
            drop-shadow(0 0 8px rgba(255, 170, 54, 0.4));
    }
    100% {
        transform: scale(1.015);
        filter: saturate(1.18) contrast(1.08) brightness(1.08)
            drop-shadow(0 0 6px rgba(255, 235, 172, 0.8))
            drop-shadow(0 0 11px rgba(255, 196, 83, 0.52));
    }
}

@keyframes battleModeIconHaloSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes battleModeIconHaloPulse {
    0%, 100% { opacity: 0.35; transform: scale(0.99); }
    50% { opacity: 0.75; transform: scale(1.02); }
}

.character-name-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.character-name {
    font-size: 16px;
    font-weight: bold;
    color: #7b3f00;
}

.side-score {
    display: inline-block;
    font-size: 12px;
    font-weight: bold;
    color: #7b3f00;
    background: #fff7e8;
    border: 1px solid #efc27d;
    border-radius: 999px;
    padding: 4px 8px;
    width: fit-content;
}

.side-skill-name {
    font-size: 11px;
    font-weight: 800;
    color: #6f3d00;
}

.side-skill-state {
    font-size: 11px;
    color: #7b4e13;
}

.side-skill-button {
    width: fit-content;
    border: 1px solid #b67b3b;
    border-radius: 999px;
    background: #f4e5cc;
    color: #6a3a00;
    font-size: 11px;
    font-weight: 900;
    padding: 4px 10px;
}

.side-skill-button:disabled {
    opacity: 0.56;
}

.side-skill-button.ready {
    border-color: #ff9b2f;
    background: linear-gradient(180deg, #ffe49f 0%, #ffc66a 100%);
    box-shadow: 0 0 10px rgba(255, 173, 66, 0.52);
    animation: skill-ready-glow 1.6s ease-in-out infinite;
}

#skill-confirm-yes-button.ready {
    border-color: #ff9b2f;
    background: linear-gradient(180deg, #ffe49f 0%, #ffc66a 100%);
    box-shadow: 0 0 10px rgba(255, 173, 66, 0.52);
    animation: skill-ready-glow 1.6s ease-in-out infinite;
}

@keyframes skill-ready-glow {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.14); }
    100% { filter: brightness(1); }
}

.panel-box {
    padding: 8px;
    margin-bottom: 8px;
    background: rgba(255,255,255,0.55);
}

.panel-box h3 {
    margin: 0 0 6px 0;
    font-size: 14px;
}

.card-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 60px;
}

.compact-row {
    min-height: 70px;
}

.card {
    width: 68px;
    height: 92px;
    border-radius: 10px;
    border: 2px solid #d97a00;
    background: #fffdf8;
    box-sizing: border-box;
    padding: 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    text-align: center;
    transition: transform 0.12s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
    overflow: hidden;
    position: relative;
}

.card:hover {
    transform: translateY(-2px);
}

.trap-locked-card {
    border-color: #ff7b7b;
    box-shadow: 0 0 0 2px rgba(255, 120, 120, 0.22), 0 1px 6px rgba(0,0,0,0.2);
}

.trap-locked-card::after {
    content: 'トラップ';
    position: absolute;
    top: 2px;
    right: 2px;
    padding: 1px 5px;
    font-size: 9px;
    border-radius: 8px;
    background: rgba(171, 23, 23, 0.88);
    color: #fff5f5;
    font-weight: 900;
}

.card-title {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 4px;
    line-height: 1.2;
}

.card-desc {
    font-size: 10px;
    color: #555;
    line-height: 1.2;
}

.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 4px 4px 4px;
    padding: 3px 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.88);
    color: #6a3500;
    font-size: 10px;
    font-weight: bold;
    line-height: 1.1;
    box-shadow: 0 1px 2px 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: 2px solid #8d8d8d;
    cursor: default;
}

.card-back:hover {
    transform: none;
}

.card-back-label {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    background: rgba(0,0,0,0.35);
    padding: 2px 6px;
    border-radius: 8px;
}

.selected-card {
    outline: 4px solid #26a65b;
    outline-offset: -3px;
}

.pack-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    min-height: 32px;
}

.pack-chip {
    background: #dff5ff;
    border: 2px solid #79bddf;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: bold;
}

.shop-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

button {
    border: none;
    border-radius: 9px;
    background: #1e9b71;
    color: white;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

button:hover:not(:disabled) {
    background: #167b5a;
}

button:disabled {
    background: #98b8ab;
    cursor: default;
}

#cook-button.has-recipe-alert {
    position: relative;
}

#cook-button.has-recipe-alert::after {
    content: '!';
    position: absolute;
    top: -9px;
    right: -9px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ff4f5a;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.28);
}

.deck-discard-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.pile {
    width: 68px;
    height: 92px;
    border-radius: 10px;
    background: #e4ded6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 3px #c3bbb1;
    overflow: hidden;
    position: relative;
    text-align: center;
    padding: 6px;
    box-sizing: border-box;
}

.clickable-pile {
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.clickable-pile:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 3px #c3bbb1, 0 2px 8px rgba(0,0,0,0.12);
}

.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.82);
    padding: 2px 6px;
    border-radius: 8px;
}

.pile-title {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 4px;
    line-height: 1.1;
}

.pile-count {
    font-size: 22px;
    font-weight: bold;
    line-height: 1;
}

.bottom-info-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.8fr;
    gap: 8px;
}

.small-box {
    min-height: 180px;
}

.candidate-area {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
}

.recipe-option {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    align-items: center;
    background: #fffdf8;
    border: 1px solid #f0d1a0;
    border-radius: 8px;
    padding: 6px;
}

.recipe-meta {
    font-size: 11px;
    line-height: 1.25;
}

.log-area {
    background: #fffaf2;
    border: 1px solid #f0d5a3;
    border-radius: 8px;
    min-height: 130px;
    max-height: 160px;
    overflow-y: auto;
    padding: 8px;
    font-size: 11px;
    line-height: 1.35;
}

.log-entry {
    margin-bottom: 4px;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.dish-history-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.dish-summary-panel {
    min-height: 200px;
}

.latest-dish-slot {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 160px;
}

.latest-dish-empty {
    min-height: 130px;
    border: 2px dashed #ddb777;
    border-radius: 12px;
    background: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8a6a34;
    font-size: 13px;
    text-align: center;
    padding: 10px;
    box-sizing: border-box;
}

.latest-dish-hint {
    font-size: 11px;
    color: #8a5b17;
    text-align: center;
}

.dish-card {
    width: 100%;
    max-width: 150px;
    min-height: 210px;
    margin: 0 auto;
    border-radius: 12px;
    border: 2px solid #d79a2d;
    background: linear-gradient(180deg, #fff8e9 0%, #ffe8b5 100%);
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.compact-dish-card {
    cursor: pointer;
    transition: transform 0.12s ease;
}

.compact-dish-card:hover {
    transform: translateY(-2px);
}

.dish-card.has-dish-image {
    background: #fff8e9;
}

.dish-art {
    position: absolute;
    inset: 0;
    background-size: contain;
    background-position: center top;
    background-repeat: no-repeat;
    background-color: #fff8e9;
}

.dish-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px;
    background: linear-gradient(180deg, rgba(0,0,0,0.0) 0%, rgba(0,0,0,0.72) 100%);
    color: white;
}

.dish-title {
    font-size: 15px;
    font-weight: bold;
    line-height: 1.2;
}

.dish-title.text-only {
    color: #8a4a00;
    padding: 10px 10px 4px 10px;
}

.dish-points {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.85);
    color: #7a3a00;
    font-size: 12px;
    font-weight: bold;
}

.dish-points.text-only {
    margin-left: 10px;
    background: #fff1c9;
}

.dish-required {
    font-size: 11px;
    line-height: 1.35;
    color: #6d4e1c;
    padding: 8px 10px 10px 10px;
}

.dish-history-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    justify-items: center;
}

.selection-panel {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 4000;
    width: min(92vw, 720px);
    max-height: 78vh;
    overflow-y: auto;
    box-shadow: 0 18px 50px rgba(0,0,0,0.28);
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(4px);
}

#selection-panel:not(.hidden),
#set-confirm-panel:not(.hidden),
#event-confirm-panel:not(.hidden),
#set-view-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.22);
}

.selection-panel.hidden {
    display: none !important;
}

.selection-description {
    font-size: 12px;
    margin-bottom: 6px;
}

.selection-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 60px;
    margin-bottom: 8px;
}

.selection-choice {
    min-width: 70px;
    padding: 8px;
    background: #fffdf8;
    border: 2px solid #d8c3a0;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    font-size: 11px;
    font-weight: bold;
}

.selection-choice.active {
    border-color: #26a65b;
    background: #effcf4;
}

.selection-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    position: sticky;
    bottom: 0;
    background: rgba(255,255,255,0.96);
    padding-top: 8px;
    padding-bottom: 2px;
}

.pile-view-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.pile-card-item {
    background: #fffdf8;
    border-radius: 8px;
    border: 1px solid #efd4a2;
    padding: 8px;
}

.pile-card-item.ingredient-item {
    background: #fff8ee;
    border-color: #e9b15e;
}

.pile-card-item.event-item {
    background: #f8f1ff;
    border-color: #b694ea;
}

.pile-card-name {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 4px;
}

.pile-card-type {
    font-size: 10px;
    color: #666;
}

.reference-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.phase-guide-layout {
    margin-top: 10px;
}

.phase-guide-box {
    padding: 10px 12px;
}

.phase-guide-flow {
    margin: 6px 0 8px 0;
    font-size: 13px;
    font-weight: 900;
    color: #7b3f00;
    line-height: 1.45;
}

.phase-guide-note {
    font-size: 11px;
    color: #6a5a44;
    line-height: 1.4;
}

.reference-box {
    padding: 8px;
}

.reference-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 11px;
    line-height: 1.3;
}

.reference-item {
    background: #fffdf8;
    border: 1px solid #efd4a2;
    border-radius: 8px;
    padding: 6px;
}

.reference-title {
    font-weight: bold;
    color: #7b3f00;
    margin-bottom: 4px;
}

.mini-rule-box {
    margin-top: 10px;
    background: #fffaf0;
    border: 1px solid #efc27d;
    border-radius: 10px;
    padding: 8px;
}

.mini-rule-title {
    font-size: 13px;
    font-weight: bold;
    color: #8a4c00;
    margin-bottom: 6px;
}

.mini-rule-text {
    font-size: 11px;
    line-height: 1.5;
    color: #5b4630;
}

#set-confirm-panel {
    border-color: #6bb98b;
    background: #f2fff5;
}

#event-confirm-panel {
    border-color: #8f5bd2;
    background: #faf2ff;
}

#set-view-panel {
    border-color: #c97c1c;
    background: #fff6e8;
}

#pile-confirm-panel,
#pile-view-panel,
#end-turn-confirm-panel,
#dish-history-panel {
    border-color: #4e8ecf;
    background: #f2f8ff;
}

@media (max-width: 1200px) {
    .battle-layout {
        grid-template-columns: 1fr;
    }

    .bottom-info-grid {
        grid-template-columns: 1fr;
    }

    .dish-history-row {
        grid-template-columns: 1fr;
    }

    .dish-history-list {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .pile-view-list {
        grid-template-columns: 1fr;
    }

    .reference-layout {
        grid-template-columns: 1fr;
    }

    .result-text {
        font-size: 48px;
        padding: 20px 28px;
    }

    .selection-panel {
        width: min(94vw, 640px);
        max-height: 82vh;
    }

    .spotlight-card {
        width: 210px;
        min-height: 320px;
    }

    .spotlight-art {
        height: 250px;
    }

    .spotlight-badge {
        font-size: 17px;
    }

    .spotlight-card.skill,
    .spotlight-card.battle-mode,
    .spotlight-card.battle-mode-text {
        width: min(94vw, 760px);
    }

    .spotlight-card.skill .spotlight-art,
    .spotlight-card.battle-mode .spotlight-art {
        height: clamp(190px, 44vw, 380px);
    }

    .spotlight-card.skill .spotlight-name,
    .spotlight-card.battle-mode .spotlight-name {
        font-size: clamp(18px, 4.6vw, 30px);
    }

    .spotlight-card.skill .spotlight-sub,
    .spotlight-card.battle-mode .spotlight-sub {
        font-size: clamp(12px, 3.2vw, 18px);
    }
}

/* ===== v2 feature bridge (desktop web keeps existing layout) ===== */

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

#game-container.theme-default {
    background: transparent;
}

#game-container.theme-white {
    background: linear-gradient(180deg, #fffefe 0%, #f3f6ff 100%);
}

#game-container.theme-sky {
    background: linear-gradient(180deg, #e9f4ff 0%, #d8ecff 100%);
}

#game-container.theme-forest {
    background: linear-gradient(180deg, #e9f7ed 0%, #d9f0e1 100%);
}

#game-container.theme-sunset {
    background: linear-gradient(180deg, #fff0e2 0%, #ffe0df 100%);
}

.hud-button {
    border-radius: 9px;
    background: #3867d6;
    color: #fff;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: bold;
}

.hud-button:hover:not(:disabled) {
    background: #2f56b4;
}

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

.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-mai,
.start-char-portrait.char-mai {
    background-image: url("assets/images/character-icons/mai-icons.png");
    background-size: 380% auto;
}

.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-akatsuki,
.start-char-portrait.char-akatsuki {
    background-image: url("assets/images/character-icons/akatsuki-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.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.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.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%;
}

.pack-card {
    border-color: #4cb5cc;
    background: #f2fcff;
}

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

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

.reference-pack-art {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    border: 1px solid #9fd9eb;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

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

.condition-warning {
    color: #b23a48;
    font-weight: bold;
}

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

.ingredient-combo-item {
    background: #fffdf8;
    border: 1px solid #efd4a2;
    border-radius: 8px;
    padding: 8px;
}

.ingredient-combo-title {
    font-size: 13px;
    font-weight: bold;
    color: #7b3f00;
    margin-bottom: 4px;
}

.ingredient-combo-status {
    font-size: 12px;
    color: #5e4738;
}

#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.22);
}

#pack-confirm-panel {
    border-color: #2ea7bf;
    background: #eefcff;
}

#ingredient-action-panel {
    border-color: #6d91d8;
    background: #f3f8ff;
}

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

.info-overlay-panel {
    width: min(96vw, 760px);
    max-height: 82vh;
    overflow: hidden;
    border-radius: 16px;
    background: #fffefc;
    border: 2px solid #efc27d;
    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: 10px;
    padding: 12px;
    border-bottom: 1px solid #efc27d;
}

.info-overlay-header h2 {
    margin: 0;
    font-size: 20px;
    color: #7b3f00;
}

.info-overlay-content {
    overflow-y: auto;
    padding: 12px;
    box-sizing: border-box;
    font-size: 13px;
    line-height: 1.45;
    color: #5f4938;
}

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

.settings-label {
    display: block;
    margin-top: 6px;
    margin-bottom: 3px;
    font-size: 12px;
    font-weight: bold;
    color: #6a3e16;
}

.settings-select {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #d6b182;
    background: #fffdfa;
    color: #4b3320;
    font-size: 12px;
    font-weight: bold;
    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: #2a5ea8;
}

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

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

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

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

.settings-bg-shop-title {
    font-size: 12px;
    font-weight: 900;
    color: #6a3e16;
}

.settings-bg-shop-item {
    display: grid;
    grid-template-columns: 66px 1fr auto;
    gap: 8px;
    align-items: center;
    border: 1px solid #efd4a2;
    border-radius: 10px;
    padding: 6px;
    background: #fffdf8;
}

.settings-bg-thumb {
    width: 66px;
    height: 66px;
    border-radius: 8px;
    border: 1px solid #dfc18f;
    background-color: #f4e9d5;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

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

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

.settings-bg-shop-desc {
    font-size: 11px;
    color: #6f5a45;
    line-height: 1.3;
}

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

.settings-bg-buy-button:disabled {
    background: #aabfd3;
}

.info-rule-block {
    background: #fffdf8;
    border: 1px solid #efd4a2;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 8px;
}

.info-rule-title {
    font-size: 14px;
    font-weight: 900;
    color: #7b3f00;
    margin-bottom: 6px;
}

.info-log-entry {
    background: #fffdf8;
    border: 1px solid #efd4a2;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 6px;
}

.start-overlay {
    position: fixed;
    inset: 0;
    z-index: 6000;
    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, 460px);
    border-radius: 20px;
    background: #fff9ef;
    border: 2px solid #efc27d;
    box-shadow: 0 20px 56px rgba(0,0,0,0.38);
    padding: 16px;
    box-sizing: border-box;
    text-align: center;
    color: #5f3a0d;
}

.start-title {
    margin: 0;
    font-size: 30px;
    color: #a54b00;
}

.start-subtitle {
    margin: 8px 0 14px 0;
    font-size: 13px;
    color: #7a5d48;
}

.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: #f5e6cf;
    border: 2px solid #dfb57d;
    color: #744113;
    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%);
    border-color: #2f89dd;
    color: #fff;
}

.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-turn-stage.hidden {
    display: none;
}

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

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

.start-turn-card {
    min-height: 88px;
    background: #f5e6cf;
    border: 2px solid #dfb57d;
    color: #744113;
    font-size: 14px;
}

.start-turn-card.revealed {
    background: linear-gradient(180deg, #79dcff 0%, #1c86db 100%);
    color: #fff;
}

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

.start-battle-message {
    min-height: 18px;
    margin-top: 10px;
    color: #8a4c00;
    font-weight: 900;
}

/* ===== Start Overlay v2 (web) ===== */
.start-panel {
    width: min(92vw, 460px);
    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-button {
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(168, 214, 255, 0.22);
    color: #e8f5ff;
}

.start-main-button {
    margin-bottom: 12px;
}

.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);
    color: #e8f5ff;
    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-turn-message {
    color: #d8ecff;
}

.start-battle-message {
    color: #ffd784;
}

.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(38vh, 280px);
    overflow-y: auto;
    padding-right: 3px;
}

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

.start-bg-shop-art {
    width: 78px;
    height: 78px;
    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: 12px;
    font-weight: 900;
    color: #ffeab0;
    margin-bottom: 3px;
}

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

.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: 8px 10px;
    font-size: 11px;
    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: 164px;
    height: 164px;
    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: 188px;
    height: 188px;
    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%, 138px);
    margin: 0;
    min-height: 164px;
    height: 164px;
    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%, 138px);
    margin: 0;
    min-height: 164px;
    height: 164px;
    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: 78px;
    right: 16px;
    z-index: 5400;
    width: min(320px, 42vw);
    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: 10px;
    color: #e8f6ff;
}

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

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

.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: 11px;
    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: 3px;
}

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

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

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

.story-episode-summary {
    font-size: 11px;
    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: 8px 10px;
    font-size: 11px;
    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: 10px;
    display: grid;
    gap: 8px;
}

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

.story-speaker-icon {
    width: 66px;
    height: 66px;
    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: 13px;
    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: 10px;
    font-size: 12px;
    line-height: 1.6;
    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: 10px;
    display: grid;
    gap: 8px;
    text-align: left;
}

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

.story-objective-note {
    font-size: 11px;
    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: 11px;
    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;
}

@media (max-width: 980px) {
    .story-hud-panel {
        width: min(320px, 86vw);
        top: 72px;
        right: 8px;
    }
}

/* ===== 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;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    cursor: grab;
}

#player-hand-mixed::-webkit-scrollbar,
#cpu-hand-mixed::-webkit-scrollbar,
#player-set::-webkit-scrollbar,
#cpu-set::-webkit-scrollbar,
#player-packs::-webkit-scrollbar,
#cpu-packs::-webkit-scrollbar {
    height: 8px;
}

#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 .candidate-area {
    max-height: 184px;
    overflow-y: auto;
    padding-right: 4px;
}

.candidate-recipes-panel.expanded .candidate-area {
    max-height: 294px;
}

.candidate-recipes-panel .recipe-cancel-row {
    position: sticky;
    bottom: 0;
    z-index: 1;
    padding-top: 6px;
    background: linear-gradient(180deg, rgba(255, 243, 221, 0) 0%, rgba(255, 243, 221, 0.96) 36%, rgba(255, 243, 221, 1) 100%);
}
