/* ============================================================
   小游戏通用样式（/css/games/common.css）
   依赖站点主题变量：[data-theme="dark"] 自动适配深色模式
   类名前缀 gk-（GamesKit），与各游戏私有类名互不干扰
   ============================================================ */

/* ---------- 页面骨架 ---------- */
.gk-page { padding: 14px 0 20px; }

.gk-hero {
    border-radius: 20px;
    padding: 22px 24px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #d946ef 100%);
    box-shadow: 0 14px 34px rgba(99, 102, 241, .25);
}

.gk-hero-emoji { font-size: 46px; line-height: 1; filter: drop-shadow(0 3px 6px rgba(0,0,0,.2)); }
.gk-hero h1 { margin: 0 0 5px; font-size: 21px; font-weight: 800; }
.gk-hero p { margin: 0; font-size: 13px; line-height: 1.7; opacity: .9; }

.gk-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
}

.gk-panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 14px;
}

.gk-panel-title h2 { margin: 0; font-size: 16px; font-weight: 800; color: #1f2937; }

.gk-note { font-size: 12.5px; line-height: 1.9; color: #6b7280; margin: 14px 0 0; }
.gk-note code { background: #f3f4f6; padding: 1px 6px; border-radius: 5px; font-size: 12px; }

/* ---------- HUD（分数 / 时间 / 状态） ---------- */
.gk-hud {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.gk-hud .cell {
    flex: 1;
    min-width: 88px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 14px;
    text-align: center;
}

.gk-hud .k { font-size: 11.5px; color: #94a3b8; font-weight: 600; margin-bottom: 3px; }
.gk-hud .v { font-size: 22px; font-weight: 800; color: #111827; font-variant-numeric: tabular-nums; }
.gk-hud .v.hot { color: #ef4444; }
.gk-hud .v.cool { color: #10b981; }

/* ---------- 按钮 ---------- */
.gk-btn {
    border: 0;
    border-radius: 12px;
    background: #6366f1;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 12px 30px;
    cursor: pointer;
    transition: transform .12s, background .15s, box-shadow .15s;
    box-shadow: 0 6px 16px rgba(99, 102, 241, .3);
}

.gk-btn:hover { background: #4f46e5; transform: translateY(-1px); }
.gk-btn:active { transform: translateY(1px) scale(.98); }
.gk-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.gk-btn.ghost {
    background: #eef2ff;
    color: #4f46e5;
    border: 1px solid #c7d2fe;
    box-shadow: none;
}
.gk-btn.ghost:hover { background: #e0e7ff; }

.gk-btn.sm { padding: 7px 14px; font-size: 13px; border-radius: 9px; }

/* ---------- 覆盖层（开始 / 结束） ---------- */
.gk-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(17, 24, 39, .72);
    backdrop-filter: blur(3px);
    border-radius: inherit;
    z-index: 20;
    text-align: center;
    padding: 20px;
}

.gk-overlay[hidden] { display: none; }

.gk-overlay .big-emoji { font-size: 54px; line-height: 1; }
.gk-overlay h3 { margin: 0; color: #fff; font-size: 22px; font-weight: 800; }
.gk-overlay p { margin: 0; color: rgba(255,255,255,.85); font-size: 13.5px; line-height: 1.8; max-width: 420px; }

/* ---------- 排行榜 ---------- */
.gk-board { width: 100%; }

.gk-board-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.gk-name {
    flex: 1;
    min-width: 150px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 14px;
    font-weight: 600;
    outline: none;
    color: #111827;
    background: #fff;
    transition: border-color .15s;
}
.gk-name:focus { border-color: #6366f1; }

.gk-chips { display: flex; gap: 6px; }

.gk-chip {
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #4b5563;
    border-radius: 999px;
    padding: 7px 13px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
}
.gk-chip:hover { border-color: #a5b4fc; color: #4f46e5; }
.gk-chip.on { background: #6366f1; border-color: #6366f1; color: #fff; }

.gk-list { list-style: none; margin: 0; padding: 0; }

.gk-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13.5px;
    color: #374151;
}

.gk-list li:last-child { border-bottom: 0; }

.gk-list .rk {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    font-weight: 800;
    font-size: 12.5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gk-list li.r1 .rk { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #78350f; }
.gk-list li.r2 .rk { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #1f2937; }
.gk-list li.r3 .rk { background: linear-gradient(135deg, #fed7aa, #ea580c); color: #7c2d12; }
.gk-list li.me { background: #eef2ff; border-radius: 10px; border-bottom-color: transparent; }
.gk-list li.me .nm { color: #4338ca; font-weight: 800; }

.gk-list .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: #111827; }
.gk-list .mt { flex: none; font-size: 11px; color: #9ca3af; }
.gk-list .sc { flex: none; font-weight: 800; color: #111827; font-variant-numeric: tabular-nums; }

.gk-board-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 12px;
    color: #94a3b8;
    flex-wrap: wrap;
}

.gk-mine {
    background: #eef2ff;
    border: 1px dashed #c7d2fe;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 13px;
    color: #4338ca;
    font-weight: 600;
    margin-top: 10px;
}

.gk-empty { text-align: center; color: #9ca3af; font-size: 13px; padding: 26px 0; }

/* ---------- 浮动提示 ---------- */
.gk-toast {
    position: fixed;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%) translateY(20px);
    background: rgba(17, 24, 39, .92);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 12px;
    opacity: 0;
    pointer-events: none;
    transition: all .25s;
    z-index: 99;
}

.gk-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 通用小工具 ---------- */
.gk-center { text-align: center; }
.gk-row { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.gk-canvas-wrap { position: relative; line-height: 0; }

/* ---------- 深色模式 ---------- */
[data-theme="dark"] .gk-panel { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); }
[data-theme="dark"] .gk-panel-title h2 { color: #f3f4f6; }
[data-theme="dark"] .gk-note { color: #9ca3af; }
[data-theme="dark"] .gk-note code { background: rgba(255,255,255,.08); }
[data-theme="dark"] .gk-hud .cell { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.12); }
[data-theme="dark"] .gk-hud .v { color: #f9fafb; }
[data-theme="dark"] .gk-btn.ghost { background: rgba(99,102,241,.15); color: #a5b4fc; border-color: rgba(99,102,241,.35); }
[data-theme="dark"] .gk-name { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.15); color: #f9fafb; }
[data-theme="dark"] .gk-chip { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.14); color: #d1d5db; }
[data-theme="dark"] .gk-chip.on { background: #6366f1; border-color: #6366f1; color: #fff; }
[data-theme="dark"] .gk-list li { color: #d1d5db; border-bottom-color: rgba(255,255,255,.07); }
[data-theme="dark"] .gk-list .nm { color: #f3f4f6; }
[data-theme="dark"] .gk-list .sc { color: #f9fafb; }
[data-theme="dark"] .gk-list .rk { background: rgba(255,255,255,.09); color: #9ca3af; }
[data-theme="dark"] .gk-list li.me { background: rgba(99,102,241,.16); }
[data-theme="dark"] .gk-list li.me .nm { color: #a5b4fc; }
[data-theme="dark"] .gk-mine { background: rgba(99,102,241,.14); border-color: rgba(129,140,248,.4); color: #c7d2fe; }

@media (max-width: 560px) {
    .gk-hero { padding: 16px; }
    .gk-hero-emoji { font-size: 34px; }
    .gk-hero h1 { font-size: 18px; }
    .gk-panel { padding: 15px; }
    .gk-hud .v { font-size: 18px; }
}
