/* styles/main.css — Shape Sort */
:root {
    --bg-top: #e3f2fd;
    --bg-bot: #80deea;
    --panel: #fffef7;
    --ink: #2c3e50;
    --accent: #039be5;
    --accent-dark: #0277bd;
    --good: #2ecc71;
    --font: "Fredoka", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: var(--font);
    color: var(--ink);
    background: linear-gradient(180deg, #e3f2fd 0%, #b2ebf2 50%, #80deea 100%);
    background-attachment: fixed;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#game-container {
    width: min(100vw, 520px);
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.6rem 0.6rem 1rem;
    gap: 0.4rem;
}

header {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.4rem;
}

.home-link {
    text-decoration: none;
    font-size: 1.4rem;
    line-height: 1;
    padding: 0.25rem 0.4rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.55);
}

h1 {
    margin: 0;
    font-size: clamp(1.1rem, 4.2vw, 1.5rem);
    font-weight: 700;
    text-align: center;
    color: #0277bd;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.6);
}

#stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25;
    background: rgba(255, 255, 255, 0.55);
    padding: 0.3rem 0.5rem;
    border-radius: 10px;
    white-space: nowrap;
}

#combo { color: #0288d1; }

main {
    position: relative;
    width: 100%;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0;
}

#gameCanvas {
    display: block;
    width: 100%;
    max-width: 480px;
    height: auto;
    max-height: min(70vh, 640px);
    border-radius: 18px;
    border: 4px solid #fff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    background: #e1f5fe;
    touch-action: none;
}

.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 40, 60, 0.35);
    border-radius: 18px;
    padding: 1rem;
}

.overlay.hidden { display: none; }

.panel {
    background: var(--panel);
    border-radius: 20px;
    padding: 1.4rem 1.2rem;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 3px solid #4fc3f7;
}

.panel h2 {
    margin: 0 0 0.6rem;
    font-size: 1.55rem;
    color: #0277bd;
}

.panel p {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    line-height: 1.35;
}

.panel .hint {
    font-size: 0.85rem;
    opacity: 0.75;
    margin-bottom: 1rem;
}

#start-btn {
    font-family: var(--font);
    font-size: 1.25rem;
    font-weight: 700;
    padding: 0.7rem 2rem;
    border: none;
    border-radius: 999px;
    background: var(--accent);
    color: white;
    cursor: pointer;
    box-shadow: 0 5px 0 var(--accent-dark);
}

#start-btn:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 var(--accent-dark);
}

.bottom-bar {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem 0;
}

.tip {
    margin: 0;
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.45);
    padding: 0.4rem 0.6rem;
    border-radius: 10px;
}

#done-btn {
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    padding: 0.65rem 1rem;
    border: none;
    border-radius: 999px;
    background: #2ecc71;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 0 #27ae60;
}

#done-btn:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #27ae60;
}

@media (max-height: 700px) {
    h1 { font-size: 1.05rem; }
    #stats { font-size: 0.68rem; }
}
