@import url('https://fonts.googleapis.com/css2?family=Jacquard+12&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
}

body {
    background-color: #0d0b1a;
    font-family: sans-serif;
}

canvas {
    cursor: default;
    outline: none;
    display: block;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

td {
    padding: 0;
    margin: 0;
}

/* ── Animated pixel background ── */
#bg-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
}

/* ── Loading screen: 5-row grid, middle 3 rows are content, outer 2 soak up space ── */
#embed-html-container {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    display: grid;
    grid-template-rows: 1fr auto auto auto auto 1fr;
    align-items: center;
    justify-items: center;
    padding: clamp(20px, 5vw, 60px);
    text-align: center;
    row-gap: clamp(16px, 3vh, 32px);
}

/* ── Game title ── */
.jacquard-12-regular {
    font-family: "Jacquard 12", system-ui;
    font-weight: 400;
    font-size: clamp(36px, 10vw, 90px);
    line-height: 1;
    color: #e8d9ff;
    text-shadow: 0 0 40px rgba(140, 100, 255, 0.55), 0 2px 0 #2a1a5e;
    letter-spacing: clamp(1px, 0.5vw, 4px);
}

/* ── Progress ring ── */
#ring-wrap {
    position: relative;
    width: clamp(72px, 16vw, 120px);
    height: clamp(72px, 16vw, 120px);
}

.ring-bg {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 6px solid rgba(255, 255, 255, 0.07);
}

#ring-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

#pct-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(13px, 3vw, 20px);
    font-weight: 600;
    font-family: monospace;
    color: #d0c4ff;
}

/* ── Loading label ── */
#loader-label {
    font-size: clamp(11px, 2.5vw, 14px);
    color: rgba(180, 160, 255, 0.55);
    font-family: monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ── Play button — always in the grid, fades in when ready ── */
#play-btn {
    padding: clamp(8px, 2vw, 12px) clamp(24px, 6vw, 48px);
    border: 1px solid rgba(180, 140, 255, 0.45);
    color: #e0d0ff;
    font-size: clamp(13px, 3vw, 16px);
    border-radius: 8px;
    background: rgba(80, 50, 160, 0.2);
    cursor: pointer;
    font-family: "Jacquard 12", monospace;
    letter-spacing: 2px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s, background 0.3s, border-color 0.3s, transform 0.1s;
}

#play-btn:hover {
    background: rgba(110, 70, 210, 0.4);
    border-color: rgba(200, 160, 255, 0.8);
}

#play-btn:active {
    transform: scale(0.97);
}

/* ── Web edition tag ── */
#tag {
    font-size: clamp(10px, 2vw, 13px);
    position: fixed;
    top: 12px;
    left: 12px;
    font-family: monospace;
    color: rgba(100, 220, 130, 0.8);
    border: 1px solid rgba(100, 220, 130, 0.3);
    border-radius: 6px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
    text-transform: uppercase;
    z-index: 99999999;
}

/* ── Game canvas container ── */
#embed-html {
    position: fixed;
    inset: 0;
    z-index: 1;
}

@keyframes spin { to { transform: rotate(360deg); } }