/* 도깨비불 — minigame view. Uses the shared --mg-* lacquer/ivory tokens. */

#mg-modal .dkb-wrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
    min-height: 0;
    padding: 2px;
}

/* ---------- menu ---------- */

#mg-modal .dkb-menu {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 4px;
}

#mg-modal .dkb-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 20px;
    border-radius: 14px;
    border: 1px solid rgba(240, 199, 90, .28);
    background:
        radial-gradient(120% 160% at 12% 0%, rgba(87, 196, 238, .16), transparent 60%),
        linear-gradient(180deg, var(--mg-lac-hi), var(--mg-lac-deep));
    box-shadow: inset 0 1px 0 rgba(255, 233, 168, .12), 0 8px 22px rgba(0, 0, 0, .3);
}

#mg-modal .dkb-hero-flame {
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 42% 36%, #ffffff 0 12%, #cdf1ff 22%, #57c4ee 52%, #2a86c8 74%, rgba(42, 134, 200, 0) 100%);
    box-shadow: 0 0 22px rgba(87, 196, 238, .55);
    animation: dkbFloat 2.4s ease-in-out infinite;
}

@keyframes dkbFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-5px) scale(1.05); }
}

#mg-modal .dkb-hero-txt h2 {
    margin: 0 0 4px;
    font-family: var(--mg-disp);
    font-size: 26px;
    letter-spacing: .05em;
    color: var(--mg-gold-hi);
}

#mg-modal .dkb-hero-txt p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--mg-sub-d);
}

#mg-modal .dkb-acts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

#mg-modal .dkb-rooms-card { margin-top: 4px; }

#mg-modal .dkb-roomlist {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
}

#mg-modal .dkb-rrow {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .5);
    border: 1px solid rgba(122, 102, 68, .25);
}

#mg-modal .dkb-rrow-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#mg-modal .dkb-rrow-main b {
    color: var(--mg-brown);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#mg-modal .dkb-rrow-sub { font-size: 11.5px; color: var(--mg-brown-sub); }
#mg-modal .dkb-rrow-cnt {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    color: var(--mg-brown);
    font-size: 13px;
}

/* ---------- room ---------- */

#mg-modal .dkb-room {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    overflow-y: auto;
}

#mg-modal .dkb-room-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

#mg-modal .dkb-code {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12.5px;
    color: var(--mg-sub-d);
}

#mg-modal .dkb-code b {
    font-family: var(--mg-disp);
    font-size: 25px;
    letter-spacing: .14em;
    color: var(--mg-gold-hi);
}

#mg-modal .dkb-copy { padding: 5px 11px; font-size: 12px; }

#mg-modal .dkb-seats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

#mg-modal .dkb-seat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 14px 6px 11px;
    border-radius: 12px;
    border: 1.6px solid rgba(240, 199, 90, .22);
    background: linear-gradient(180deg, rgba(21, 82, 69, .75), rgba(7, 30, 25, .8));
    min-width: 0;
}

#mg-modal .dkb-seat.is-mine {
    border-color: var(--mg-gold);
    box-shadow: 0 0 0 1px rgba(240, 199, 90, .28), 0 0 20px rgba(240, 199, 90, .22);
}

#mg-modal .dkb-seat.is-empty { opacity: .5; }

#mg-modal .dkb-seat-key {
    font-family: var(--mg-disp);
    font-size: 30px;
    line-height: 1;
    color: var(--mg-gold);
}

#mg-modal .dkb-seat.is-mine .dkb-seat-key { color: var(--mg-gold-hi); }

#mg-modal .dkb-seat-name {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--mg-text-d);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#mg-modal .dkb-seat-st { font-size: 11px; color: var(--mg-sub-d); }
#mg-modal .dkb-ok { color: var(--mg-jade); font-weight: 800; }

#mg-modal .dkb-lvrow,
#mg-modal .dkb-room-acts {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

#mg-modal .dkb-lbl { font-size: 12.5px; color: var(--mg-sub-d); margin-right: 2px; }
#mg-modal .dkb-lv { padding: 7px 13px; font-size: 12.5px; }

#mg-modal .dkb-netrow {
    font-size: 12px;
    color: var(--mg-sub-d);
    padding: 8px 12px;
    border-radius: 9px;
    border: 1px dashed var(--mg-line-d);
}

#mg-modal .dkb-hint {
    font-size: 12px;
    color: var(--mg-gold-mid);
    text-align: center;
}

/* ---------- play ---------- */

#mg-modal .dkb-play {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    min-height: 0;
}

#mg-modal .dkb-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1.6px solid rgba(240, 199, 90, .3);
    background: #0a1b23;
}

#mg-modal .dkb-stage iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

#mg-modal .dkb-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--mg-lac-deep);
    color: var(--mg-sub-d);
    font-size: 13px;
    letter-spacing: .04em;
}

#mg-modal .dkb-pads {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    flex: 0 0 auto;
}

#mg-modal .dkb-pad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 4px 8px;
    border-radius: 12px;
    border: 1.6px solid rgba(240, 199, 90, .18);
    background: linear-gradient(180deg, rgba(21, 82, 69, .6), rgba(7, 30, 25, .75));
    color: var(--mg-sub-d);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    transition: transform .08s, box-shadow .12s, border-color .12s;
}

#mg-modal .dkb-pad:disabled { opacity: .38; cursor: default; }

#mg-modal .dkb-pad.is-mine {
    border-color: var(--mg-gold);
    color: var(--mg-gold-hi);
    background: linear-gradient(180deg, rgba(240, 199, 90, .18), rgba(7, 30, 25, .8));
}

#mg-modal .dkb-pad.is-hit {
    transform: translateY(2px) scale(.97);
    box-shadow: 0 0 18px rgba(87, 196, 238, .5);
    border-color: #57c4ee;
}

#mg-modal .dkb-pad-k { font-family: var(--mg-disp); font-size: 24px; line-height: 1.1; }
#mg-modal .dkb-pad-n {
    font-size: 10.5px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#mg-modal .dkb-play-acts { display: flex; justify-content: flex-end; flex: 0 0 auto; }

/* ---------- help ---------- */

#mg-modal .dkb-help {
    list-style: none;
    margin: 6px 0 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

#mg-modal .dkb-help li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--mg-brown);
}

#mg-modal .dkb-h-n {
    flex: 0 0 auto;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: #4a3410;
    background: linear-gradient(180deg, #ffe193, var(--mg-gold));
}

#mg-modal .dkb-help-tip {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--mg-brown-sub);
    padding: 10px 12px;
    border-radius: 9px;
    background: rgba(122, 102, 68, .1);
    border: 1px dashed rgba(122, 102, 68, .35);
}

/* ---------- narrow screens ---------- */

@media (max-width: 620px) {
    #mg-modal .dkb-hero { padding: 14px; gap: 12px; }
    #mg-modal .dkb-hero-flame { width: 42px; height: 42px; }
    #mg-modal .dkb-hero-txt h2 { font-size: 21px; }
    #mg-modal .dkb-seat { padding: 10px 4px 8px; }
    #mg-modal .dkb-seat-key { font-size: 24px; }
    #mg-modal .dkb-seat-name { font-size: 11px; }
    #mg-modal .dkb-code b { font-size: 21px; }
    #mg-modal .dkb-pad-k { font-size: 21px; }
    #mg-modal .dkb-acts { grid-template-columns: repeat(2, 1fr); }
}
