/* ═══════════════════════════════════════════════════════════
   Minigame Campaign – Game Styles v4 (Drag & Drop + Images)
   Mobile-first · Dark theme
═══════════════════════════════════════════════════════════ */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }

/* ── Root ───────────────────────────────────────────────── */
.mgc-app {
    --mgc-primary: #e63946;
    --mgc-bg:      #0f0f1a;
    --mgc-surface: #16213e;
    --mgc-text:    #f0f0f0;
    --mgc-muted:   rgba(240,240,240,.55);
    --mgc-radius:  14px;
    --mgc-font:    'Inter', sans-serif;
    font-family: var(--mgc-font);
    background:  var(--mgc-bg);
    color:       var(--mgc-text);
    min-height:  100vh;
    position:    relative;
    overflow-x:  hidden;
	max-width:100%;
	width:100%;
}
.ct-container-full {
    padding: 0;
}

/* ── Steps ──────────────────────────────────────────────── */
.mgc-step {
    max-width: 520px;
    margin:    0 auto;
    padding:   18px 14px 40px;
    animation: mgcSlideIn .35s ease;
}
.mgc-step#mgc-step-game { max-width: 560px; }
@keyframes mgcSlideIn { from{opacity:0;transform:translateY(18px)} to{opacity:1;transform:translateY(0)} }

/* ── Step badge ─────────────────────────────────────────── */
.mgc-step-badge {
    display:inline-block;
    background:rgba(230,57,70,.15);
    border:1px solid rgba(230,57,70,.3);
    color:var(--mgc-primary);
    border-radius:20px;
    padding:4px 12px;
    font-size:11px; font-weight:700; letter-spacing:.8px;
    margin-bottom:12px;
}

/* ── Banner ─────────────────────────────────────────────── */
.mgc-banner { position:relative; max-height:200px; overflow:hidden; }
.mgc-banner img { width:100%; height:100%; object-fit:cover; display:block; }
.mgc-banner-overlay { position:absolute; inset:0; background:linear-gradient(to bottom, transparent 40%, var(--mgc-bg)); }

/* ── Landing ────────────────────────────────────────────── */
.mgc-landing-body { padding:16px 0 28px; text-align:center; }
.mgc-brand-badge {
    display:inline-block;
    background:linear-gradient(135deg,#e63946,#ff8c42);
    color:#fff; border-radius:6px; padding:4px 14px;
    font-size:12px; font-weight:800; letter-spacing:2px; margin-bottom:12px;
}
.mgc-title {
    font-size:26px; font-weight:900; margin-bottom:7px; line-height:1.15;
    background:linear-gradient(135deg,#fff 0%,rgba(255,255,255,.65) 100%);
    -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text;
}
.mgc-subtitle { font-size:15px; font-weight:600; color:var(--mgc-primary); margin-bottom:13px; }
.mgc-desc     { font-size:14px; color:var(--mgc-muted); line-height:1.6; margin-bottom:20px; }
.mgc-car-hero { position:relative; max-width:300px; margin:16px auto; }
.mgc-car-img  { width:100%; filter:drop-shadow(0 10px 28px rgba(230,57,70,.22)); animation:mgcFloat 4s ease-in-out infinite; }
.mgc-car-placeholder { font-size:70px; }
.mgc-trunk-glow {
    position:absolute; bottom:0; left:50%; transform:translateX(-50%);
    width:70%; height:28px;
    background:radial-gradient(ellipse,rgba(230,57,70,.3),transparent 70%);
    filter:blur(8px);
}
@keyframes mgcFloat { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
.mgc-date-note { font-size:12px; color:var(--mgc-muted); margin-top:14px; }

/* ── Buttons ────────────────────────────────────────────── */
.mgc-btn {
    display:inline-flex; align-items:center; justify-content:center; gap:6px;
    border:2px solid transparent; border-radius:50px; cursor:pointer;
    font-family:var(--mgc-font); font-weight:700; font-size:14px; padding:12px 24px;
    transition:all .2s ease; text-decoration:none; white-space:nowrap;
}
.mgc-btn--primary { background:linear-gradient(135deg,var(--mgc-primary),#ff5a5f); color:#fff; box-shadow:0 4px 16px rgba(230,57,70,.35); }
.mgc-btn--primary:hover { transform:translateY(-2px); box-shadow:0 7px 24px rgba(230,57,70,.5); }
.mgc-btn--outline { background:transparent; color:var(--mgc-primary); border-color:var(--mgc-primary); }
.mgc-btn--outline:hover { background:rgba(230,57,70,.1); }
.mgc-btn--large  { padding:15px 36px; font-size:16px; }
.mgc-btn--full   { width:100%; margin-top:10px; }
.mgc-btn--pulse  { animation:mgcPulse 2.4s ease-in-out infinite; }
@keyframes mgcPulse { 0%,100%{box-shadow:0 4px 16px rgba(230,57,70,.35)} 50%{box-shadow:0 6px 28px rgba(230,57,70,.65)} }
.mgc-btn:disabled { opacity:.45; cursor:not-allowed; transform:none !important; }

/* ── Form ───────────────────────────────────────────────── */
.mgc-form-wrap h2   { font-size:20px; margin-bottom:5px; }
.mgc-form-intro     { font-size:13px; color:var(--mgc-muted); margin-bottom:20px; }
.mgc-field          { margin-bottom:14px; }
.mgc-field label    { display:block; font-size:13px; font-weight:600; margin-bottom:6px; }
.mgc-field .req     { color:var(--mgc-primary); }
.mgc-field input,
.mgc-field select {
    width:100%; background:rgba(255,255,255,.07); border:1.5px solid rgba(255,255,255,.18);
    border-radius:10px; color:#fff; font-family:var(--mgc-font); font-size:15px; padding:12px 14px;
    transition:border-color .2s; -webkit-appearance:none;
}
.mgc-field input:focus,
.mgc-field select:focus { outline:none; border-color:var(--mgc-primary); background:rgba(255,255,255,.1); }
.mgc-field select option { background:#1a1a2e; color:#fff; }

/* ── Game wrap ──────────────────────────────────────────── */
.mgc-game-wrap { display:flex; flex-direction:column; gap:14px; }
.mgc-game-header { text-align:center; }
.mgc-game-title  { font-size:19px; font-weight:800; margin-bottom:4px; }
.mgc-game-hint   { font-size:13px; color:var(--mgc-muted); }

/* ── Timer ──────────────────────────────────────────────── */
.mgc-timer-wrap { display:flex; justify-content:center; }
.mgc-timer { position:relative; width:72px; height:72px; }
.mgc-timer-ring { position:absolute; inset:0; transform:rotate(-90deg); }
.mgc-timer-ring-bg       { fill:none; stroke:rgba(255,255,255,.12); stroke-width:6; }
.mgc-timer-ring-progress { fill:none; stroke:var(--mgc-primary); stroke-width:6; stroke-linecap:round; transition:stroke-dashoffset 1s linear; }
.mgc-timer-text { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.mgc-timer-text span  { font-size:22px; font-weight:900; line-height:1; }
.mgc-timer-text small { font-size:10px; color:var(--mgc-muted); margin-top:1px; }
.mgc-timer--urgent .mgc-timer-ring-progress { stroke:#ff3a3a; }
.mgc-timer--urgent .mgc-timer-text span     { color:#ff3a3a; animation:mgcBlink .5s linear infinite; }
@keyframes mgcBlink { 50%{opacity:.35} }

/* ══════════════════════════════════════════
   GRID PUZZLE
══════════════════════════════════════════ */
.mgc-puzzle-container {
    background:  rgba(255,255,255,.04);
    border:      2px solid rgba(255,255,255,.12);
    border-radius:var(--mgc-radius);
    padding:     12px;
}
.mgc-trunk-header {
    display:        flex;
    justify-content:space-between;
    align-items:    center;
    margin-bottom:  10px;
}
.mgc-trunk-title { font-size:13px; font-weight:800; letter-spacing:.5px; color:var(--mgc-muted); }
.mgc-fill-badge {
    background:   linear-gradient(135deg,var(--mgc-primary),#ff8c42);
    color:#fff; border-radius:20px; padding:3px 11px;
    font-size:12px; font-weight:800;
    transition:background .3s;
}

/* ── Trunk Grid ─────────────────────────────────────────── */
.mgc-trunk-frame {
    position: relative;
}

/* Trunk background image (car boot photo) */
.mgc-trunk-bg {
    position:       absolute;
    inset:          0;
    width:          100%;
    height:         100%;
    object-fit:     cover;
    object-position: center;
    border-radius:  8px;
    z-index:        0;
    pointer-events: none;
    opacity:        0.5;
    display:        block;
}

.mgc-trunk-grid {
    display:      grid;
    gap:          2px;
    width:        100%;
    aspect-ratio: 8/6;
    user-select:  none;
    border:       2px solid rgba(255,255,255,.15);
    border-radius:8px;
    padding:      3px;
    background:   rgba(0,0,0,.25);
}

/* ── Grid Cell ──────────────────────────────────────────── */
.mgc-cell {
    background:    rgba(255,255,255,.06);
    border:        1px solid rgba(255,255,255,.1);
    border-radius: 3px;
    cursor:        pointer;
    transition:    background .12s, transform .1s, border-color .12s;
    position:      relative;
    overflow:      hidden;
}
.mgc-cell:hover:not(.mgc-cell--filled) {
    background: rgba(255,255,255,.13);
}

/* Filled cell */
.mgc-cell--filled {
    background:    var(--item-color, #e63946) !important;
    border-color:  rgba(255,255,255,.3) !important;
    cursor:        pointer;
    box-shadow:    inset 0 1px 0 rgba(255,255,255,.3), inset 0 -1px 0 rgba(0,0,0,.25);
    transition:    background .2s, transform .15s, box-shadow .15s;
}
.mgc-cell--filled:hover {
    filter:    brightness(1.15);
    transform: scale(1.04);
    z-index:   2;
    box-shadow: 0 0 0 2px rgba(255,255,255,.4), inset 0 1px 0 rgba(255,255,255,.3);
}

/* Image inside a filled cell */
.mgc-cell-img {
    position:   absolute;
    inset:      0;
    width:      100%;
    height:     100%;
    object-fit: cover;
    border-radius: 3px;
    pointer-events: none;
}
/* Multi-cell spanning image (anchored at top-left, overflows to cover full shape) */
.mgc-cell-img--span {
    position:   absolute;
    top:        0;
    left:       0;
    inset:      unset;
    object-fit: cover;
    border-radius: 4px;
    pointer-events: none;
    z-index:    2;
}
.mgc-cell-emoji {
    position:        absolute;
    inset:           0;
    display:         flex;
    align-items:     center;
    justify-content: center;
    font-size:       1.1em;
    pointer-events:  none;
}

/* Ghost previews */
.mgc-cell--ghost-ok  {
    background: rgba(45,198,83,.38) !important;
    border-color: #2dc653 !important;
    box-shadow: inset 0 0 0 2px rgba(45,198,83,.6);
    transform: scale(1.02);
    transition: all .08s;
}
.mgc-cell--ghost-bad {
    background: rgba(230,57,70,.35) !important;
    border-color: #e63946 !important;
    box-shadow: inset 0 0 0 2px rgba(230,57,70,.6);
    transition: all .08s;
}

/* Shake animation */
@keyframes mgcShake {
    0%,100%{ transform:translateX(0) }
    20%    { transform:translateX(-5px) }
    40%    { transform:translateX(5px) }
    60%    { transform:translateX(-4px) }
    80%    { transform:translateX(4px) }
}
.mgc-shake { animation:mgcShake .38s ease; }

/* ── Progress bar ───────────────────────────────────────── */
.mgc-progress-wrap  { margin-top:10px; }
.mgc-progress-track {
    position:     relative;
    background:   rgba(255,255,255,.1);
    border-radius:99px;
    height:       16px;
    overflow:     visible;
}
.mgc-progress-fill {
    height:        100%;
    border-radius: 99px;
    background:    linear-gradient(90deg, #2dc653, #f5c518, var(--mgc-primary));
    transition:    width .3s ease;
    width:         0%;
}
.mgc-progress-target {
    position:      absolute;
    top:           -5px;
    width:         3px;
    height:        26px;
    background:    #fff;
    border-radius: 2px;
    box-shadow:    0 0 8px rgba(255,255,255,.7);
}
.mgc-progress-target::after {
    content:'🎯';
    position:absolute; top:-20px; left:50%; transform:translateX(-50%);
    font-size:12px;
}
.mgc-progress-labels {
    display:        flex;
    justify-content:space-between;
    font-size:      11px;
    color:          var(--mgc-muted);
    margin-top:     5px;
}

/* ══════════════════════════════════════════
   DRAG & DROP
══════════════════════════════════════════ */

/* Floating ghost that follows the cursor */
.mgc-drag-ghost {
    position:   fixed;
    top:        0;
    left:       0;
    z-index:    9999;
    pointer-events: none;
    opacity:    0;
    transition: opacity .12s;
    background: rgba(20,20,40,.92);
    border:     2px solid var(--mgc-primary);
    border-radius: 10px;
    padding:    8px;
    box-shadow: 0 8px 32px rgba(0,0,0,.5), 0 0 0 1px rgba(230,57,70,.3);
    display:    flex;
    flex-direction: column;
    align-items: center;
    gap:         5px;
    min-width:   60px;
    max-width:   120px;
    transform:   rotate(-3deg) scale(1.08);
    backdrop-filter: blur(4px);
}
.mgc-drag-ghost img {
    width:  64px;
    height: 64px;
    object-fit: contain;
    border-radius: 6px;
}
.mgc-drag-ghost span {
    font-size:   10px;
    font-weight: 700;
    color:       #fff;
    text-align:  center;
    max-width:   100px;
    line-height: 1.3;
}
/* Mini ghost shape cells */
.mgc-ghost-cell {
    width:  14px;
    height: 14px;
    border-radius: 3px;
    background: rgba(255,255,255,.1);
}
.mgc-ghost-cell.on {
    background: var(--gcolor, #e63946);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.4);
}

/* ── Items panel ────────────────────────────────────────── */
.mgc-puzzle-items-section { }
.mgc-select-hint {
    font-size:13px; color:var(--mgc-muted);
    text-align:center; margin-bottom:10px;
    min-height: 20px;
    transition: color .2s;
}
.mgc-items-scroll {
    display:        flex;
    gap:            8px;
    overflow-x:     auto;
    padding:        6px 2px 10px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.mgc-items-scroll::-webkit-scrollbar { height:4px; }
.mgc-items-scroll::-webkit-scrollbar-track { background:rgba(255,255,255,.06); border-radius:2px; }
.mgc-items-scroll::-webkit-scrollbar-thumb { background:var(--mgc-primary); border-radius:2px; }

/* Item card */
.mgc-puzzle-item {
    flex:           0 0 auto;
    background:     rgba(255,255,255,.07);
    border:         2px solid rgba(255,255,255,.18);
    border-radius:  12px;
    padding:        10px 8px 7px;
    cursor:         grab;
    text-align:     center;
    transition:     all .18s cubic-bezier(.17,.89,.32,1.1);
    scroll-snap-align: start;
    min-width:      78px;
    max-width:      96px;
    display:        flex;
    flex-direction: column;
    align-items:    center;
    gap:            5px;
    position:       relative;
    touch-action:   none;   /* prevent scroll conflict during drag */
    user-select:    none;
    -webkit-user-select: none;
}
.mgc-puzzle-item:hover:not(:disabled):not(.mgc-puzzle-item--used) {
    border-color: rgba(230,57,70,.6);
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 6px 20px rgba(230,57,70,.25);
}
.mgc-puzzle-item:active:not(:disabled):not(.mgc-puzzle-item--used) {
    cursor: grabbing;
    transform: translateY(-1px) scale(1.05);
}
.mgc-puzzle-item--selected {
    border-color: var(--mgc-primary) !important;
    background:   rgba(230,57,70,.18) !important;
    box-shadow:   0 0 0 3px rgba(230,57,70,.25), 0 6px 20px rgba(230,57,70,.3);
    transform:    translateY(-3px) scale(1.04);
}
.mgc-puzzle-item--used {
    opacity: .38;
    cursor:  not-allowed;
    filter:  grayscale(.6);
    transform: none !important;
}

/* Image mode item */
.mgc-item-img-wrap {
    width:  60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0,0,0,.2);
}
.mgc-item-img {
    width:  100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
    border-radius: 6px;
    transition: transform .2s;
}
.mgc-puzzle-item:hover .mgc-item-img { transform: scale(1.08); }

/* Mini shape grid */
.mgc-mini-shape {
    display:   grid;
    gap:       2px;
    padding:   2px;
}
.mgc-mini-cell {
    width:        10px;
    height:       10px;
    border-radius:2px;
    background:   rgba(255,255,255,.1);
}
.mgc-mini-cell.on { opacity:1; box-shadow:inset 0 1px 0 rgba(255,255,255,.3); }

.mgc-item-name {
    font-size:  10px;
    font-weight:700;
    color:      var(--mgc-muted);
    line-height:1.2;
    text-align: center;
    max-width:  80px;
    word-break: break-word;
}
.mgc-item-check {
    position:absolute; top:4px; right:5px;
    font-size:12px; color:#2dc653;
}

/* ── Game actions ───────────────────────────────────────── */
.mgc-game-actions { display:flex; gap:10px; justify-content:center; }

/* ── Result ─────────────────────────────────────────────── */
.mgc-result-wrap    { text-align:center; padding:18px 0; }
.mgc-result-icon    { font-size:62px; margin-bottom:12px; animation:mgcPop .4s cubic-bezier(.17,.89,.32,1.3); }
@keyframes mgcPop { from{transform:scale(0) rotate(-15deg);opacity:0} to{transform:scale(1) rotate(0);opacity:1} }
.mgc-result-title   { font-size:22px; font-weight:900; margin-bottom:8px; }
.mgc-result-message { font-size:14px; color:var(--mgc-muted); line-height:1.65; margin-bottom:14px; }
.mgc-key-message {
    background:linear-gradient(135deg,rgba(230,57,70,.15),rgba(255,140,66,.12));
    border:1px solid rgba(230,57,70,.4); border-radius:12px;
    padding:14px 16px; font-size:14px; font-weight:700; line-height:1.6;
    margin-bottom:18px; text-align:left;
}
.mgc-prize-options h3 { font-size:15px; margin-bottom:12px; }
.mgc-prize-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:12px; }
.mgc-prize-card { cursor:pointer; }
.mgc-prize-card input { display:none; }
.mgc-prize-card-inner { background:rgba(255,255,255,.06); border:2px solid rgba(255,255,255,.15); border-radius:12px; padding:16px 10px; text-align:center; transition:all .2s; }
.mgc-prize-card input:checked + .mgc-prize-card-inner { border-color:var(--mgc-primary); background:rgba(230,57,70,.12); }
.mgc-prize-icon { font-size:26px; margin-bottom:6px; }
.mgc-prize-name { font-weight:800; font-size:13px; margin-bottom:3px; }
.mgc-prize-desc { font-size:11px; color:var(--mgc-muted); line-height:1.5; }
.mgc-wallet-types { display:flex; gap:12px; margin-top:8px; font-size:13px; }
.mgc-wallet-types label { display:flex; align-items:center; gap:4px; cursor:pointer; }

/* ── Confirm ────────────────────────────────────────────── */
.mgc-confirm-wrap   { text-align:center; padding:8px 0; }
.mgc-confirm-icon   { font-size:48px; margin-bottom:12px; }
.mgc-confirm-wrap h2{ font-size:20px; margin-bottom:7px; }
.mgc-confirm-sub    { font-size:13px; color:var(--mgc-muted); margin-bottom:20px; }
.mgc-confirm-card   { background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.12); border-radius:12px; padding:14px; text-align:left; margin-bottom:18px; }
.mgc-confirm-row    { display:flex; justify-content:space-between; align-items:center; padding:8px 0; border-bottom:1px solid rgba(255,255,255,.07); font-size:13px; }
.mgc-confirm-row:last-child { border-bottom:none; }
.mgc-confirm-row span { color:var(--mgc-muted); }
.mgc-testdrive-box  { background:linear-gradient(135deg,rgba(230,57,70,.12),rgba(255,140,66,.1)); border:1px solid rgba(230,57,70,.35); border-radius:var(--mgc-radius); padding:18px 16px; margin-bottom:18px; }
.mgc-testdrive-icon { font-size:30px; margin-bottom:8px; }
.mgc-testdrive-box h3 { font-size:15px; font-weight:800; margin-bottom:6px; }
.mgc-testdrive-box p  { font-size:13px; color:var(--mgc-muted); line-height:1.6; margin-bottom:14px; }
.mgc-confirm-note   { font-size:12px; color:var(--mgc-muted); line-height:1.6; border-top:1px solid rgba(255,255,255,.08); padding-top:14px; text-align:left; }

/* ── Alerts ─────────────────────────────────────────────── */
.mgc-alert         { background:rgba(255,193,7,.1); border:1px solid rgba(255,193,7,.35); border-radius:10px; padding:11px 14px; font-size:13px; margin-bottom:14px; }
.mgc-alert--error  { background:rgba(230,57,70,.13); border-color:rgba(230,57,70,.4); }

/* ── Loading ────────────────────────────────────────────── */
.mgc-loading { position:absolute; inset:0; background:rgba(15,15,26,.88); display:flex; flex-direction:column; align-items:center; justify-content:center; z-index:999; border-radius:var(--mgc-radius); }
.mgc-spinner { width:42px; height:42px; border:4px solid rgba(255,255,255,.15); border-top-color:var(--mgc-primary); border-radius:50%; animation:mgcSpin .7s linear infinite; }
.mgc-loading-text { font-size:12px; color:var(--mgc-muted); margin-top:10px; }
@keyframes mgcSpin { to{transform:rotate(360deg)} }

/* ── Responsive ─────────────────────────────────────────── */
@media(max-width:420px) {
    .mgc-step { padding:12px 10px 28px; }
    .mgc-title { font-size:22px; }
    .mgc-game-title { font-size:16px; }
    .mgc-prize-grid { grid-template-columns:1fr; }
    .mgc-mini-cell  { width:9px; height:9px; }
    .mgc-puzzle-item { min-width:70px; padding:8px 6px; }
    .mgc-item-img-wrap { width:52px; height:52px; }
}
