:root {
    --red: #ff4d4d;
    --red-active: #ff9999;
    --yellow: #ffcc00;
    --yellow-active: #ffee99;
    --blue: #3399ff;
    --blue-active: #99ccff;
    --green: #33cc33;
    --green-active: #99ff99;
    --bg-color: #1a1a2e;
    --text-color: #ffffff;
    --primary-btn: #e94560;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#app {
    width: 100%;
    height: 100%;
    max-width: 600px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-color);
    z-index: 10;
    transition: opacity 0.3s ease;
}

.screen.active {
    display: flex;
}

.title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.subtitle {
    font-size: 1.5rem;
    margin-bottom: 40px;
    opacity: 0.8;
}

.btn-primary {
    background-color: var(--primary-btn);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.4);
    transition: transform 0.1s, box-shadow 0.1s;
}

.btn-primary:active {
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(233, 69, 96, 0.4);
}

/* Game Screen */
#game-screen {
    justify-content: flex-start;
    padding: 20px;
}

.header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 20px;
    font-size: 1.5rem;
    font-weight: bold;
}

.game-board {
    position: relative;
    width: 90vw;
    height: 90vw;
    max-width: 500px;
    max-height: 500px;
    margin-top: 20px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    border: 10px solid #2a2a40;
}

.color-btn {
    width: 50%;
    height: 50%;
    cursor: pointer;
    transition: background-color 0.1s;
    opacity: 0.8;
}

.color-btn.active {
    opacity: 1;
    filter: brightness(1.5);
}

.red { background-color: var(--red); border-right: 5px solid #2a2a40; border-bottom: 5px solid #2a2a40; }
.yellow { background-color: var(--yellow); border-left: 5px solid #2a2a40; border-bottom: 5px solid #2a2a40; }
.blue { background-color: var(--blue); border-right: 5px solid #2a2a40; border-top: 5px solid #2a2a40; }
.green { background-color: var(--green); border-left: 5px solid #2a2a40; border-top: 5px solid #2a2a40; }

.center-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40%;
    height: 40%;
    background-color: #2a2a40;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 5px solid #1a1a2e;
    z-index: 5;
}

#message {
    font-size: 1.2rem;
    margin-bottom: 5px;
    text-align: center;
}

#timer {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-btn);
}

/* Animations */
@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.blink {
    animation: blink 1s infinite;
    color: var(--red);
}

.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}
