:root {
    --bg-color: #f0f4f8;
    --app-bg: white;
    --text-color: #2d3436;
    --primary-color: #ef5350; /* Singapore Red */
    --secondary-color: #ff8a80;
    --heading-color: #c62828;
    --shadow-color: rgba(239, 83, 80, 0.2);
}

[data-theme="dark"] {
    --bg-color: #1a1c1e;
    --app-bg: #2d3436;
    --text-color: #dfe6e9;
    --primary-color: #ef5350;
    --secondary-color: #e57373;
    --heading-color: #ff8a80;
    --shadow-color: rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

#app {
    text-align: center;
    background: var(--app-bg);
    padding: 3rem 2rem;
    border-radius: 30px;
    box-shadow: 0 20px 50px var(--shadow-color);
    width: 100%;
    max-width: 420px;
    margin: 20px;
    position: relative;
    overflow: hidden;
}

.theme-toggle-container {
    position: absolute;
    top: 20px;
    right: 20px;
}

#theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.main-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

h1 {
    color: var(--heading-color);
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.description {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.input-group {
    margin-bottom: 2rem;
}

input {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--bg-color);
    border-radius: 15px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
    text-align: center;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

input:focus {
    border-color: var(--primary-color);
}

#start-btn, #restart-btn {
    padding: 16px;
    width: 100%;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 8px 20px var(--shadow-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

#start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px var(--shadow-color);
}

.hidden { display: none !important; }

/* Merlion Loader */
.merlion-loader {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.progress-container {
    width: 100%;
    height: 10px;
    background: var(--bg-color);
    border-radius: 5px;
    margin-top: 15px;
    overflow: hidden;
}

#progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary-color);
    transition: width 0.1s;
}

/* Result View */
.result-score {
    font-size: 5rem;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.result-score span {
    font-size: 2rem;
}

#result-content {
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    white-space: pre-line;
    padding: 0 10px;
}

#contact-container {
    margin-top: 3rem;
}

hr {
    border: none;
    border-top: 1px solid var(--bg-color);
    margin-bottom: 1.5rem;
}

.contact-title {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--heading-color);
    margin-bottom: 1rem;
    opacity: 0.7;
}

#contact-container form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#contact-container input, #contact-container textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--bg-color);
    border-radius: 10px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.9rem;
    box-sizing: border-box;
    font-family: inherit;
}

#contact-container textarea {
    height: 80px;
    resize: none;
}

#submit-btn {
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    border-radius: 10px;
    background: var(--text-color);
    color: var(--app-bg);
    transition: opacity 0.2s;
}

#submit-btn:hover {
    opacity: 0.8;
}

/* Disqus Container */
#disqus_container {
    margin-top: 3rem;
    text-align: left; /* Disqus looks better left-aligned */
}

#disqus_container hr {
    margin-bottom: 2rem;
}

#disqus_thread {
    width: 100%;
    min-height: 300px;
}
