/* ===== 贪吃蛇 · 专属样式 ===== */

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

.gs-glow {
    position: absolute;
    top: -120px;
    left: 50%;
    width: 480px;
    height: 460px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(74, 222, 128, 0.2) 0%, transparent 70%);
    pointer-events: none;
    transition: background 0.3s ease;
}

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

.gs-brand { display: flex; flex-direction: column; gap: 4px; }
.gs-logo {
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1;
    color: #065f46;
    background: linear-gradient(135deg, #10b981, #22c55e);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.gs-tagline {
    font-size: 13px;
    color: #6fa58c;
    font-weight: 500;
}

.gs-scores { display: flex; gap: 10px; }
.gs-score-box {
    min-width: 74px;
    padding: 9px 14px;
    border-radius: 12px;
    background: #065f46;
    color: #fff;
    text-align: center;
    box-shadow: 0 6px 16px rgba(6, 95, 70, 0.3);
}
.gs-score-box.best { background: #059669; box-shadow: 0 6px 16px rgba(5, 150, 105, 0.4); }
.gs-score-label {
    font-size: 11px;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 700;
}
.gs-score-value {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    margin-top: 2px;
    transition: transform 0.18s ease;
}
.gs-score-value.bump { transform: scale(1.18); }

/* ---- 操作行 ---- */
.gs-actions {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 420px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.gs-btn {
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid #c8e6d5;
    background: #fff;
    color: #065f46;
    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;
}
.gs-btn:hover { background: #ecfdf5; transform: translateY(-1px); }
.gs-btn:active { transform: translateY(0); }
.gs-btn.primary {
    background: linear-gradient(135deg, #10b981, #22c55e);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 18px rgba(16, 185, 129, 0.4);
}
.gs-btn.primary:hover { background: linear-gradient(135deg, #059669, #16a34a); }
.gs-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.gs-hint {
    margin-left: auto;
    font-size: 12.5px;
    color: #6fa58c;
}
.gs-hint kbd {
    display: inline-block;
    padding: 2px 7px;
    margin: 0 1px;
    border-radius: 5px;
    background: #fff;
    border: 1px solid #c8e6d5;
    border-bottom-width: 2px;
    font-size: 11px;
    font-family: ui-monospace, monospace;
    color: #065f46;
}

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

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

.gs-grid {
    position: absolute;
    inset: 8px;
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    grid-template-rows: repeat(20, 1fr);
    gap: 1px;
}
.gs-grid .gs-cell {
    background: #064e3b;
    border-radius: 2px;
}

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

/* 蛇身 */
.gs-seg {
    position: absolute;
    width: 5%;
    height: 5%;
    box-sizing: border-box;
    padding: 1px;
    border-radius: 4px;
    transition: transform 0.09s linear;
    will-change: transform;
}
.gs-seg .inner {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    background: #34d399;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 2px 4px rgba(0, 0, 0, 0.3);
}
.gs-seg.head .inner {
    background: #a7f3d0;
    box-shadow: inset 0 0 0 1px rgba(6, 95, 70, 0.5), 0 3px 8px rgba(167, 243, 208, 0.45);
}
.gs-seg.tail .inner {
    background: #10b981;
}

/* 食物 */
.gs-food {
    position: absolute;
    width: 5%;
    height: 5%;
    box-sizing: border-box;
    padding: 2px;
    border-radius: 4px;
}
.gs-food .inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fca5a5, #ef4444 70%);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
    animation: gs-pulse 0.8s ease-in-out infinite alternate;
}
@keyframes gs-pulse { from { transform: scale(0.85); } to { transform: scale(1.08); } }

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

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

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

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

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

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .gs-seg { transition: none; }
    .gs-food .inner { animation: none; }
}
