body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

.container {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;
    padding: 30px;
    text-align: center;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 30px;
}

/* --- App Header (Standardized) --- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #DA251D;
    margin-bottom: 20px;
}

.app-logo-link {
    display: flex;
    flex-direction: column;
    text-align: left;
    text-decoration: none;
    line-height: 1;
}

.brand-goigoi {
    font-size: 1.4rem;
    font-weight: 800;
    color: #DA251D;
    text-transform: lowercase;
}

.brand-calc {
    font-size: 1.4rem;
    font-weight: 800;
    color: #666;
    text-transform: lowercase;
    margin-top: -2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.language-select {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.language-select select {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

/* --- Settings & Quiz --- */
.settings-panel, .quiz-area-section {
    padding: 20px;
    border-radius: 8px;
    background-color: #fcfcfc;
    border: 1px solid #eee;
    text-align: left;
}

.settings-panel h3, .operator-settings h3 {
    color: #DA251D;
    border-bottom: 2px solid #DA251D;
    padding-bottom: 8px;
    margin-top: 0;
    font-size: 1.4rem;
}

.setting-group {
    margin-bottom: 25px;
}

.radio-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.radio-buttons input[type="radio"] {
    display: none;
}

.radio-buttons label {
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
    font-size: 0.9rem;
    text-align: center;
    user-select: none;
}

.radio-buttons input[type="radio"]:checked + label {
    background-color: #DA251D;
    color: #fff;
    border-color: #DA251D;
    font-weight: bold;
}

.quiz-area-section {
    text-align: center;
}

.question-text {
    font-size: 2.5rem;
    font-weight: 700;
    color: #555;
    margin: 20px 0;
}

.question-text.hidden {
    display: none;
}

.quiz-controls-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.control-button {
    background-color: #DA251D;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.control-button.secondary-action {
    background-color: #666;
}

.control-button:hover {
    background-color: #c0211b;
    transform: translateY(-2px);
}

.control-button.secondary-action:hover {
    background-color: #444;
}

.control-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.input-area {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 25px 0;
}

#answer-input {
    padding: 10px 15px;
    font-size: 1.1rem;
    border-radius: 8px;
    border: 2px solid #ddd;
    width: 150px;
    text-align: center;
    transition: border-color 0.3s;
}

#answer-input:focus {
    outline: none;
    border-color: #DA251D;
}

.feedback {
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 20px;
}

.feedback.correct {
    color: #28a745;
}

.feedback.incorrect {
    color: #dc3545;
}

/* --- Audio Overlays --- */
#audio-gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  z-index: 2147483647;
  -webkit-backdrop-filter: blur(1px);
  backdrop-filter: blur(1px);
}
#audio-gate.hidden { display: none !important; }
body.audio-unlocked #audio-gate { display: none !important; }

#enable-audio-btn {
  padding: 14px 20px;
  font-size: 16px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
}

/* ===== goigoi calc study domain skin ===== */
body.calc-page {
    background: radial-gradient(circle at top left, rgba(93, 109, 55, 0.10), transparent 28%), linear-gradient(180deg, #faf8f0 0%, #f4f1e6 100%);
    color: #2b2b2b;
    display: block !important;
    min-height: 100vh;
    padding: 18px 14px 32px;
}

body.calc-page .container {
    margin: 0 auto;
    max-width: 860px;
    background: #fff;
    border: 1px solid rgba(93, 109, 55, 0.14);
    border-radius: 22px;
    box-shadow: 0 16px 42px rgba(39, 49, 28, 0.08);
}

body.calc-page .brand-goigoi { color: #5d6d37; }
body.calc-page .app-header { border-bottom-color: #5d6d37; }
body.calc-page .settings-panel h3, body.calc-page .operator-settings h3 { color: #5d6d37; border-bottom-color: #5d6d37; }
body.calc-page .radio-buttons input[type="radio"]:checked + label, body.calc-page .control-button { background-color: #5d6d37; border-color: #5d6d37; color: #fff; }
body.calc-page #answer-input:focus { border-color: #5d6d37; }

@media (max-width: 640px) {
    body.calc-page { padding: 10px; }
    body.calc-page .container { padding: 18px; }
    .app-header { flex-direction: row; align-items: center; }
    .brand-goigoi { font-size: 1.2rem; }
    .brand-calc { font-size: 1.2rem; }
}
