/* setting up start screen css bit */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    height: 100vh;
    font-family: Arial, sans-serif;
    overflow: hidden;
    touch-action: none;
    user-select: none;
}

.screen {
    position: fixed;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    gap: 1.5rem;
}

.screen.active {
    display: flex;
}

#start-screen h1 {
    font-size: 2rem;
}

#start-screen p {
    color: #888;
    font-size: 1rem;
}

#start-screen button {
    padding: 1rem 2rem;
    font-size: 1rem;
    background: black;
    color: white;
    border: none;
    cursor: pointer;
}

#main-screen {
    justify-content: flex-start;
    align-items: stretch;
    padding: 0;
}

.button-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 0.8rem 1rem;
}

.button-cell {
    position: relative;
    overflow: hidden;
    background: #f7f7f7;
    border: 2px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
}

.button-label {
    font-size: 2.2rem;
    font-weight: bold;
    color: #ccc;
    position: relative;
    z-index: 2;
}

.button-cell.highlighted {
    background: #fff8e1;
    border-color: #FFC107;
}

.button-cell.highlighted .button-label {
    color: #FFC107;
}

.button-cell.activated {
    background: #e8f5e9;
    border-color: #4CAF50;
}

.button-cell.activated .button-label {
    color: #4CAF50;
}

.button-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: rgba(255, 193, 7, 0.25);
    z-index: 1;
}

#status-bar {
    padding: 0.5rem 1rem;
    text-align: center;
}

#status-text {
    font-size: 1rem;
    color: #666;
}

#top-bar {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

#speed-select {
    font-size: 1rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid #ccc;
    background: white;
}

#eval-btn {
    padding: 0.5rem 1.1rem;
    font-size: 1rem;
    background: #222;
    color: white;
    border: none;
    cursor: pointer;
    margin-left: auto;
}

#eval-btn.stop {
    background: #d32f2f;
}

#eval-stats {
    display: none;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    color: #555;
    text-align: center;
    background: #f0f0f0;
    border-top: 1px solid #ddd;
}

.button-cell.target {
    background: #fff5f5;
    border-color: #f44336;
}

.button-cell.target .button-label {
    color: #f44336;
}

#results-popup {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

#results-card {
    background: white;
    padding: 2rem;
    text-align: center;
    width: 80%;
}

#results-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

#results-card p {
    line-height: 2.2;
    font-size: 1rem;
    margin-bottom: 1.2rem;
    color: #444;
}

#results-card button {
    padding: 0.7rem 2rem;
    font-size: 1rem;
    background: #222;
    color: white;
    border: none;
    cursor: pointer;
}

#centre-msg {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
    font-weight: bold;
    color: #4CAF50;
    background: rgba(255, 255, 255, 0.96);
    padding: 0.8rem 1.8rem;
    border: 3px solid #4CAF50;
    display: none;
    z-index: 10;
}

#centre-msg.visible {
    display: block;
}