/* Perusasetukset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Bebas Neue', sans-serif; 
    touch-action: none; 
}

body {
    background-color: #2c3e50; 
    overflow: hidden;
}

/* Zoom-alue */
.zoom-area {
    width: 100vw; height: 100vh; display: flex; justify-content: center; align-items: center;
    cursor: grab; background-color: #e0e0e0; position: relative; overflow: hidden;
}
.zoom-area:active { cursor: grabbing; }

.game-container {
    width: 95vw; max-width: 500px; aspect-ratio: 1 / 1; position: relative;
    transition: transform 0.2s ease-out; will-change: transform; 
}

/* LAUDAN ALOITUSANIMAATIO */
@keyframes boardPopIn {
    0% { transform: scale(0.6); opacity: 0; }
    70% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.circular-board {
    width: 100%; height: 100%; border-radius: 50%; position: relative;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3); border: 45px solid #ff9800; 
    background-color: white; display: flex; justify-content: center; align-items: center;
    animation: boardPopIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* KYSSÄRIN ALOITUSANIMAATIO */
@keyframes centerFadeIn {
    0% { opacity: 0; transform: translate(-50%, -40%); }
    100% { opacity: 1; transform: translate(-50%, -50%); }
}

.main-question-card {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 42%; aspect-ratio: 1 / 1; background: white; border-radius: 50%;
    display: flex; justify-content: center; align-items: center; text-align: center;
    z-index: 15; box-shadow: 0 8px 20px rgba(0,0,0,0.2), inset 0 0 10px rgba(0,0,0,0.05);
    border: 2px solid #eee; padding: 15px;
    opacity: 0;
    animation: centerFadeIn 0.6s ease forwards 0.3s; /* Viivästetään hieman laudan latautumisen jälkeen */
}

.main-question-card h3 { font-size: 1.6rem; color: #222; margin: 0; line-height: 1.1; letter-spacing: 1px; }

/* NAPPULOIDEN JA TEKSTIEN ANIMAATIOT (Aalto) */
@keyframes elementPop {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    80% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes simpleFade {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.statement-label {
    position: absolute; transform: translate(-50%, -50%); font-size: 1.3rem; color: #333; 
    text-align: center; width: 85px; line-height: 1; z-index: 10; letter-spacing: 0.5px;
    opacity: 0;
    animation: simpleFade 0.4s ease forwards;
}

.lines-container { position: absolute; width: 100%; height: 100%; top: 0; left: 0; z-index: 5; }
.connecting-line { 
    position: absolute; height: 2px; background-color: #ffd180; transform-origin: left center; border-radius: 2px; 
    opacity: 0;
    animation: simpleFade 0.4s ease forwards;
}

.plugs-container { position: absolute; width: 100%; height: 100%; top: 0; left: 0; z-index: 20; }
.plug {
    position: absolute; width: 14%; height: 14%; background-color: #1a1a1a; color: white; border-radius: 50%;
    display: flex; justify-content: center; align-items: center; font-size: 2rem; cursor: pointer;
    box-shadow: 0 6px 12px rgba(0,0,0,0.5); border: 3px solid #000; transform: translate(-50%, -50%); transition: all 0.2s ease;
    opacity: 0;
    animation: elementPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.plug.opened { color: rgba(0,0,0,0.5); box-shadow: inset 0 3px 8px rgba(0,0,0,0.4); border-color: #444; }

/* ZOOM PAINIKKEET */
.zoom-controls { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 500; }
.zoom-controls button { width: 45px; height: 45px; border-radius: 50%; border: none; background-color: #ff9800; color: white; font-size: 2rem; box-shadow: 0 4px 10px rgba(0,0,0,0.3); cursor: pointer; display: flex; justify-content: center; align-items: center; line-height: 1; }
.zoom-controls button:active { background-color: #e68a00; transform: scale(0.95); }

/* MODAALI / POPUP */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.85); display: flex; justify-content: center; align-items: center; z-index: 1000; opacity: 0; visibility: hidden; transition: opacity 0.3s ease; }
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-content { background-color: white; width: 90%; max-width: 380px; padding: 25px; border-radius: 15px; text-align: center; box-shadow: 0 10px 25px rgba(0,0,0,0.5); }
.modal-content h4 { font-size: 1.5rem; color: #555; }
.statement-text { font-size: 2.2rem; margin: 20px 0; color: #ff9800; letter-spacing: 1px; }
#modal-actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.btn-row { display: flex; gap: 10px; }
#modal-actions button, #modal-result button { padding: 12px; border: none; border-radius: 8px; font-size: 1.5rem; cursor: pointer; flex: 1; letter-spacing: 1px; }
button.btn-yes { background-color: #4caf50; color: white; }
button.btn-no { background-color: #f44336; color: white; }
button.btn-neutral { background-color: #2196f3; color: white; }
.input-text { width: 100%; padding: 12px; margin-bottom: 10px; border: 2px solid #ccc; border-radius: 8px; text-align: center; font-size: 1.5rem; }
#modal-result { margin-top: 20px; padding-top: 20px; border-top: 1px solid #eee; }
#result-text { font-size: 2rem; margin-bottom: 15px; }
.hidden { display: none !important; }