@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Montserrat:wght@400;500;600;700&display=swap');
:root {
    --ink: #3b210f;
    --gold: #a86d29;
    --cream: #f4e2c4;
    --paper: #fff8ea;
    --line: #c99d63
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    color: var(--ink);
    font-family: Montserrat, Arial, sans-serif;
    background: #d9bd94
}

.game-page {
    min-height: 100vh;
    background: linear-gradient(115deg, rgba(48, 25, 10, .18), transparent 45%), url('img/bg.png') center/cover fixed
}

.game-shell {
    max-width: 1200px;
    min-height: 100vh;
    margin: auto;
    padding: 30px 30px 55px;
    background: linear-gradient(180deg, rgba(255, 248, 232, .86), rgba(255, 248, 232, .6));
    text-align: center;
    align-items: center;
    align-content: center;
}

.brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative
}

.heading {
    width: min(300px, 62vw);
    height: auto;
    mix-blend-mode: multiply
}

.icon-btn {
    position: absolute;
    right: 0;
    border: 1px solid var(--line);
    background: #fff6e5;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 18px;
    cursor: pointer
}

.hero-copy {
    margin: 15px auto 30px
}

.eyebrow {
    font-size: 11px;
    letter-spacing: 3px;
    font-weight: 700;
    color: #896033;
    margin: 0 0 8px
}

.hero-copy h1 {
    font: 600 clamp(38px, 5vw, 62px)/.9 'Cormorant Garamond', serif;
    margin: 0;
    line-height: 60px;
    margin: 15px;
    color: #5a2e10
}

.hero-copy h1 em {
    color: #a36a29;
    font-style: italic
}

.hero-copy p:last-child {
    font-size: 13px
}

.prize-preview {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px auto 25px
}

.prize-chip {
    background: rgba(255, 250, 240, .8);
    border: 1px solid #d3af7d;
    padding: 9px 15px;
    border-radius: 30px;
    font-size: 12px
}

.boxes {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    max-width: 1430px;
    margin: 0 auto
}

.box {
    min-height: 200px;
    border: 0;
    border-radius: 18px;
    background: url('img/bg-box.png') center/cover;
    box-shadow: 0 12px 24px #6e3f1b4a;
    position: relative;
    cursor: default;
    transition: transform .3s, filter .3s
}

.box::after {
    content: '?';
    font: 700 74px 'Cormorant Garamond';
    color: #fff3d2;
    text-shadow: 0 3px 8px #3b1809;
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center
}

.box.ready {
    cursor: pointer
}

.box.ready:hover {
    transform: translateY(-8px)
}

.box.open {
    background: linear-gradient(145deg, #fff8e8, #e5bd7e);
    cursor: default
}

.box.open::after {
    display: none
}

.box-inner {
    padding: 18px 10px;
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center
}

.box-inner img {
    max-width: 90px;
    max-height: 80px;
    object-fit: contain;
    margin-bottom: 8px
}

.box-prize {
    font: 600 20px 'Cormorant Garamond', serif;
    padding: 0 40px;
}

.box-value {
    font-size: 18px;
    margin-top: 3px;
    color: #5a2e10db;
    font-weight: 600;
    text-shadow: 0 0 6px #a36a29;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 28px
}

.primary-btn,
.secondary-btn {
    border: 0;
    padding: 14px 24px;
    border-radius: 30px;
    font-size: 11px;
    letter-spacing: 1.5px;
    font-weight: 700;
    cursor: pointer
}

.primary-btn {
    background: #6b3513;
    color: #fff7e7;
    box-shadow: 0 6px 14px #51250d42
}

.secondary-btn {
    background: #f8ead3;
    color: #713b17;
    border: 1px solid #ba8950
}

.primary-btn:disabled {
    opacity: .5;
    cursor: wait
}

.status {
    font-size: 12px;
    color: #79562f;
    min-height: 18px
}

.modal {
    position: fixed;
    inset: 0;
    background: #2e180bb8;
    display: grid;
    place-items: center;
    padding: 20px;
    z-index: 5
}

.modal[hidden] {
    display: none
}

.modal-card {
    background: #fff7e7;
    max-width: 440px;
    width: 100%;
    padding: 42px 30px;
    border-radius: 22px;
    text-align: center;
    box-shadow: 0 20px 50px #25100680
}

.result-icon {
    font-size: 52px;
    color: #bf8128
}

.modal h2 {
    font: 600 42px/1 'Cormorant Garamond';
    margin: 5px
}

.admin-page {
    min-height: 100vh;
    background: url('img/bg.png') center/cover fixed;
    padding: 30px
}

.admin-shell {
    max-width: 900px;
    margin: auto
}

.admin-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px
}

.admin-head a,
.text-btn {
    color: var(--gold);
    font-size: 12px;
    background: none;
    border: 0;
    cursor: pointer
}

.panel {
    background: #fff9eddd;
    border: 1px solid #dab780;
    border-radius: 18px;
    padding: 25px;
    margin-bottom: 18px;
    box-shadow: 0 10px 25px #653a1720
}

.login-panel {
    max-width: 450px;
    margin: 60px auto
}

.panel h1,
.panel h2 {
    font: 600 38px 'Cormorant Garamond';
    margin: 4px 0 18px
}

.panel h2 {
    font-size: 30px
}

.panel form {
    display: grid;
    gap: 11px
}

input,
select {
    width: 100%;
    padding: 13px;
    border: 1px solid #d3b17e;
    border-radius: 8px;
    background: #fffdf8;
    color: var(--ink)
}

.error {
    color: #a32d21;
    font-size: 12px
}

.panel-title {
    display: flex;
    justify-content: space-between;
    align-items: start
}

.prize-editor {
    display: grid;
    gap: 12px
}

.prize-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr 120px 90px;
    gap: 8px;
    align-items: center
}

.prize-row label {
    font-weight: 600;
    font-size: 13px
}

.prize-row small {
    font-size: 11px;
    color: #8e6a45
}

.admin-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px
}

.hint {
    font-size: 12px;
    color: #805f3a;
    line-height: 1.6
}

.history {
    font-size: 12px
}

.history-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    border-bottom: 1px solid #ead4b1;
    padding: 10px 0
}

.history-row:last-child {
    border-bottom: 0
}

@media(max-width:750px) {
    .game-shell {
        padding: 20px 14px 40px
    }
    .boxes {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px
    }
    .box {
        min-height: 150px
    }
    .box::after {
        font-size: 55px
    }
    .prize-row {
        grid-template-columns: 1fr 1fr
    }
    .prize-row label {
        grid-column: 1/-1
    }
    .admin-page {
        padding: 15px
    }
    .controls {
        flex-wrap: wrap
    }
}

body {
    background: #e6d3b4
}

.game-page {
    min-height: 100vh;
    background: none
}

.game-shell {
    width: 100%;
    max-width: 100%;
    background: linear-gradient(180deg, rgba(255, 248, 232, .82), rgba(255, 248, 232, .72)), url('img/bg.png') center/cover
}

.box::after {
    display: none
}

.box.closed::after {
    display: grid
}

.box.shuffling {
    animation: shuffle .18s ease-in-out infinite alternate;
    filter: brightness(1.12)
}

.box:not(.closed) .box-inner {
    background: linear-gradient(180deg, #fff8e805, #2c140a82);
    border-radius: 18px
}

@keyframes shuffle {
    from {
        transform: translateY(-5px) rotate(-1.5deg)
    }
    to {
        transform: translateY(5px) rotate(1.5deg)
    }
}

.game-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: #e6d3b4
}

.game-shell {
    margin: 0 auto;
    background: url('img/bg.png') center center/cover no-repeat
}

.prize-preview {
    display: none
}

.box {
    background-color: transparent;
    background-image: url('img/LuckyBlindBox_khp.png');
    background-size: cover;
    background-position: center;
    box-shadow: none;
    filter: drop-shadow(0 12px 10px rgba(74, 38, 12, 0.28));
}

.box:not(.closed) .box-inner {
    background: transparent;
    text-shadow: 0 1px 4px #fff
}

.box.closed {
    background-image: url('img/LuckyBlindBox_khp.png')
}

.box.closed .box-inner {
    visibility: hidden
}

.box.open {
    background-image: url('img/LuckyBlindBox_khp.png');
    background-color: transparent;
    box-shadow: none
}

.box.shuffling {
    animation: none;
    transition: transform .58s cubic-bezier(.2, .75, .25, 1);
    z-index: 2
}

.modal {
    display: none !important
}

.box.open {
    background: url('img/LuckyBlindBox_khp.png') center/cover no-repeat !important
}

.box.open .box-inner {
    visibility: visible !important
}

.controls {
    min-height: 46px
}

.win-flash .game-shell {
    animation: winGlow .7s ease-out
}

.lose-flash .game-shell {
    animation: loseGlow .7s ease-out
}

@keyframes winGlow {
    0% {
        filter: brightness(1)
    }
    45% {
        filter: brightness(1.18)
    }
    100% {
        filter: brightness(1)
    }
}

@keyframes loseGlow {
    0% {
        filter: brightness(1)
    }
    45% {
        filter: brightness(.88)
    }
    100% {
        filter: brightness(1)
    }
}


/* Admin refinement */

.admin-page {
    padding: 42px 22px;
    background: #ead8bd url('img/bg.png') center/cover fixed
}

.admin-shell {
    max-width: 1080px
}

.admin-head {
    padding: 0 8px 20px;
    border-bottom: 1px solid #caa36f
}

.admin-head .heading {
    width: 190px
}

.admin-head a {
    padding: 10px 16px;
    border: 1px solid #c59b65;
    border-radius: 999px;
    background: #fff8eb;
    color: #74451f;
    text-decoration: none
}

.panel {
    background: rgba(255, 250, 241, .92);
    border: 1px solid #d3b07c;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 14px 30px rgba(91, 51, 18, .12)
}

.login-panel {
    margin: 70px auto;
    max-width: 470px;
    text-align: center
}

.login-panel h1 {
    font-size: 42px
}

.panel h2 {
    color: #603316
}

.panel-title {
    border-bottom: 1px solid #ead6b5;
    padding-bottom: 16px;
    margin-bottom: 22px
}

.prize-editor {
    gap: 9px
}

.prize-row {
    background: #fffdf8;
    border: 1px solid #ead7b9;
    border-radius: 12px;
    padding: 10px;
    grid-template-columns: 1.2fr 1fr 170px 1.4fr
}

.prize-row label {
    color: #603316
}

.prize-row input {
    padding: 11px;
    border-color: #dbc095
}

.admin-actions {
    padding-top: 8px
}

.history {
    border: 1px solid #ead7b9;
    border-radius: 12px;
    padding: 0 14px;
    background: #fffdf8
}

.history-row {
    grid-template-columns: 1.2fr 1fr 1fr;
    padding: 13px 0
}

.history-row b {
    color: #9a6225
}

@media(max-width:750px) {
    .admin-page {
        padding: 20px 12px
    }
    .panel {
        padding: 20px
    }
    .prize-row {
        grid-template-columns: 1fr 1fr
    }
    .prize-row label {
        grid-column: 1/-1
    }
    .admin-head .heading {
        width: 150px
    }
}

.sequence-rows {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 8px;
    margin: 12px 0 16px
}

.sequence-rows label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #fffdf8;
    border: 1px solid #ead7b9;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 600
}

.sequence-rows select {
    padding: 8px;
    font-size: 12px
}

@media(max-width:600px) {
    .sequence-rows {
        grid-template-columns: 1fr
    }
}

.hero-copy .eyebrow {
    font-size: 20.4px
}

.box.selected-zoom {
    z-index: 10;
    animation: selectedZoom 1.8s cubic-bezier(.2, .75, .25, 1) forwards;
}

@keyframes selectedZoom {
    0% {
        transform: scale(1)
    }
    32% {
        transform: scale(1.38)
    }
    68% {
        transform: scale(1.38)
    }
    100% {
        transform: scale(1)
    }
}

.box.open {
    background-image: none !important;
    background-color: transparent !important
}

.box.open .result-bag {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px
}

.box.open .box-inner {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex
}

.no-zoom .selected-zoom {
    animation: none !important;
    transform: none !important
}
.box.selected-zoom{animation:none!important;transform:scale(2.2)!important;z-index:30;filter:drop-shadow(0 24px 34px rgba(70,35,10,.42))}.result-focus::before{content:'';position:fixed;inset:0;background:rgba(35,18,8,.34);z-index:25;pointer-events:none}.zoom-close{position:absolute;right:10px;top:8px;width:32px;height:32px;border:1px solid #8a5b2e;border-radius:50%;background:#fff8eb;color:#603316;font-size:23px;line-height:20px;cursor:pointer;z-index:40}.no-zoom .box.selected-zoom{transform:none!important;filter:none!important}.fireworks i{animation-duration:3.7s}
.fireworks{position:fixed;left:50%;top:48%;width:10px;height:10px;z-index:100;pointer-events:none}.fireworks i{position:absolute;width:7px;height:18px;border-radius:50%;background:hsl(var(--h),90%,60%);animation:firework 1.35s ease-out forwards;transform:translate(0,0)}@keyframes firework{0%{opacity:1;transform:translate(0,0) scale(.3)}70%{opacity:1}100%{opacity:0;transform:translate(var(--x),var(--y)) scale(1)}}
.fireworks i{animation-duration:6.8s!important}
.fireworks i{animation-duration:1.2s!important}.fireworks{z-index:120}
.box.shuffling{transition-duration:.48s}
.history-row{grid-template-columns:44px 1.2fr 1fr 1fr}.history-index{color:#9a6225}
