/* ===== 俄罗斯方块 · 专属样式 ===== */

/* ---- Hero 区域 ---- */
.gt-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 24px 32px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #eef5ff 0%, #f6faff 60%, #f0f6fc 100%);
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid #d8e3f0;
    transition: background 0.3s ease;
}

/* 光晕 */
.gt-glow {
    position: absolute;
    top: -120px;
    left: 50%;
    width: 480px;
    height: 460px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(96, 130, 255, 0.2) 0%, transparent 70%);
    pointer-events: none;
    transition: background 0.3s ease;
}

/* ---- 顶部信息行 ---- */
.gt-topbar {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    max-width: 380px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.gt-brand { display: flex; flex-direction: column; gap: 4px; }
.gt-logo {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 0.02em;
    line-height: 1;
    color: #1e3a8a;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.gt-tagline {
    font-size: 13px;
    color: #7c8aa5;
    font-weight: 500;
}

/* 分数盒子 */
.gt-scores { display: flex; gap: 10px; }
.gt-score-box {
    min-width: 74px;
    padding: 9px 14px;
    border-radius: 12px;
    background: #1f2937;
    color: #fff;
    text-align: center;
    box-shadow: 0 6px 16px rgba(31, 41, 55, 0.3);
}
.gt-score-box.best { background: #7c3aed; box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4); }
.gt-score-label {
    font-size: 11px;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 700;
}
.gt-score-value {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    margin-top: 2px;
    transition: transform 0.18s ease;
}
.gt-score-value.bump { transform: scale(1.18); }

/* ---- 操作行 ---- */
.gt-actions {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 380px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.gt-btn {
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.gt-btn:hover { background: #f1f5f9; transform: translateY(-1px); }
.gt-btn:active { transform: translateY(0); }
.gt-btn.primary {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 18px rgba(99, 102, 241, 0.4);
}
.gt-btn.primary:hover { background: linear-gradient(135deg, #2563eb, #7c3aed); }
.gt-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.gt-next {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 10px;
    background: #1f2937;
}
.gt-next-label { font-size: 12px; color: rgba(255, 255, 255, 0.7); font-weight: 700; }
.gt-next-preview {
    width: 52px;
    height: 52px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 2px;
}
.gt-next-preview .b {
    border-radius: 3px;
    opacity: 0;
}

.gt-hint {
    margin-left: auto;
    font-size: 12.5px;
    color: #7c8aa5;
}
.gt-hint kbd {
    display: inline-block;
    padding: 2px 7px;
    margin: 0 1px;
    border-radius: 5px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-bottom-width: 2px;
    font-size: 11px;
    font-family: ui-monospace, monospace;
    color: #334155;
}

/* ---- 棋盘 ---- */
.gt-board-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 380px;
}

.gt-board {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 2;
    padding: 8px;
    background: #0f172a;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.35);
    touch-action: none;
    user-select: none;
    overflow: hidden;
}

.gt-grid {
    position: absolute;
    inset: 8px;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(20, 1fr);
    gap: 1px;
}
.gt-grid .gt-cell {
    background: #1e293b;
    border-radius: 3px;
}

.gt-layer {
    position: absolute;
    inset: 8px;
    pointer-events: none;
}

/* 已锁定方块 */
.gt-cell-b {
    position: absolute;
    width: 10%;
    height: 5%;
    box-sizing: border-box;
    padding: 1px;
    border-radius: 4px;
    animation: gt-pop 0.12s ease;
}
.gt-cell-b .inner {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    background: var(--bc, #64748b);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 2px 4px rgba(0, 0, 0, 0.25);
}
@keyframes gt-pop { from { transform: scale(0.6); opacity: 0.4; } to { transform: scale(1); opacity: 1; } }

/* 活动方块（过渡动画） */
.gt-cell-a {
    position: absolute;
    width: 10%;
    height: 5%;
    box-sizing: border-box;
    padding: 1px;
    border-radius: 4px;
    transition: transform 0.11s ease;
    will-change: transform;
}
.gt-cell-a .inner {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    background: var(--bc, #64748b);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 3px 6px rgba(0, 0, 0, 0.35);
}

/* 方块配色 */
.gt-cell-b[data-k="I"], .gt-cell-a[data-k="I"] { --bc: #22d3ee; }
.gt-cell-b[data-k="O"], .gt-cell-a[data-k="O"] { --bc: #facc15; }
.gt-cell-b[data-k="T"], .gt-cell-a[data-k="T"] { --bc: #a78bfa; }
.gt-cell-b[data-k="S"], .gt-cell-a[data-k="S"] { --bc: #4ade80; }
.gt-cell-b[data-k="Z"], .gt-cell-a[data-k="Z"] { --bc: #f87171; }
.gt-cell-b[data-k="J"], .gt-cell-a[data-k="J"] { --bc: #60a5fa; }
.gt-cell-b[data-k="L"], .gt-cell-a[data-k="L"] { --bc: #fb923c; }

/* 幽灵投影（预览落点） */
.gt-cell-a.ghost .inner {
    background: transparent;
    box-shadow: inset 0 0 0 2px var(--bc, #64748b);
    opacity: 0.55;
}

/* ---- 覆盖层 ---- */
.gt-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(3px);
    border-radius: 14px;
    animation: gt-fade 0.25s ease;
}
.gt-overlay[hidden] { display: none; }
@keyframes gt-fade { from { opacity: 0; } to { opacity: 1; } }

.gt-overlay-card {
    text-align: center;
    padding: 28px 24px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.35);
    max-width: 86%;
}
.gt-overlay-emoji { font-size: 46px; line-height: 1; margin-bottom: 10px; }
.gt-overlay-title { font-size: 24px; font-weight: 900; color: #0f172a; letter-spacing: -0.02em; }
.gt-overlay-text { font-size: 14px; color: #64748b; margin: 8px 0 18px; }
.gt-overlay-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---- 移动端方向键 ---- */
.gt-dpad {
    position: relative;
    z-index: 1;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}
.gt-dpad-btn {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
    transition: transform 0.1s ease, background 0.15s ease;
    user-select: none;
}
.gt-dpad-btn:active { transform: scale(0.92); background: #f1f5f9; }

/* ---- 简介区 ---- */
.gt-info { margin-bottom: 28px; }
.gt-info .detail-title-row { margin-bottom: 16px; }
.gt-info h1 { font-size: 28px; }

/* ---- 响应式 ---- */
@media (max-width: 768px) {
    .gt-hero { padding: 28px 16px 24px; }
    .gt-topbar { gap: 14px; }
    .gt-logo { font-size: 26px; }
    .gt-tagline { display: none; }
    .gt-score-box { min-width: 62px; padding: 8px 10px; }
    .gt-score-value { font-size: 17px; }
    .gt-hint { display: none; }
    .gt-actions { gap: 8px; }
    .gt-btn { padding: 9px 14px; font-size: 13px; }
    .gt-next-preview { width: 44px; height: 44px; }
    .gt-dpad { display: flex; }
}

@media (max-width: 420px) {
    .gt-topbar { flex-direction: column; align-items: stretch; }
    .gt-scores { justify-content: center; }
    .gt-actions { justify-content: center; }
    .gt-board-wrap { max-width: 320px; }
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .gt-cell-a { transition: none; }
    .gt-cell-b, .gt-cell-a { animation: none; }
}
