.gd-root {
    display: flex;
    flex-direction: column;
}

.gd-screen.hidden { display: none !important; }

.gd-title {
    text-align: center;
    font-size: 2.2rem;
    margin: 8px 0 4px;
}

.gd-subtitle {
    text-align: center;
    color: var(--muted);
    margin: 0 0 20px;
}

.gd-level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.gd-level-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--panel);
    border: 2px solid transparent;
    border-left: 6px solid var(--theme, var(--accent));
    border-radius: 14px;
    padding: 14px 16px;
    cursor: pointer;
    color: var(--text);
    text-align: left;
    font-family: inherit;
}

.gd-level-card:hover {
    border-color: var(--theme, var(--accent));
    transform: translateY(-2px);
}

.gd-level-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--theme, var(--accent));
    color: #10132a;
    font-weight: 800;
    font-family: var(--heading-font);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.gd-level-info { flex: 1; }

.gd-level-title {
    font-weight: 700;
    margin-bottom: 2px;
}

.gd-level-stars {
    color: var(--accent);
    font-size: 0.85rem;
}

.gd-stars-num {
    color: var(--muted);
}

.gd-level-best {
    font-weight: 700;
    color: var(--muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

/* ---------- Ekran gry ---------- */

.gd-play-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.gd-play-header .back-button {
    background: var(--panel);
    border: none;
    color: var(--accent-2);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 10px;
    font-family: inherit;
}

.gd-level-name {
    font-weight: 700;
    color: var(--accent);
}

.gd-hud {
    display: flex;
    justify-content: space-around;
    background: var(--panel);
    border-radius: 12px 12px 0 0;
    padding: 8px 12px;
}

.gd-hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gd-canvas-wrap {
    position: relative;
}

#gd-canvas {
    display: block;
    width: 100%;
    height: auto;
    background: #0e1024;
    border-radius: 0 0 12px 12px;
    touch-action: manipulation;
    cursor: pointer;
}

.gd-hint {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 10px;
}

.gd-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 12, 30, 0.65);
    border-radius: 12px;
}

.gd-overlay.hidden { display: none; }

.gd-overlay-panel {
    background: var(--panel);
    border-radius: 16px;
    padding: 28px 32px;
    text-align: center;
    max-width: 320px;
}

.gd-overlay-panel h2 {
    color: var(--accent);
    margin-top: 0;
}

.gd-overlay-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.gd-overlay-actions .primary-button,
.gd-overlay-actions .secondary-button {
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-weight: 700;
    cursor: pointer;
}

.gd-overlay-actions .primary-button {
    background: linear-gradient(180deg, #7ee787, #35b04a);
    color: #0e1024;
}

.gd-overlay-actions .secondary-button {
    background: transparent;
    border: 1px solid var(--accent-2);
    color: var(--accent-2);
}
