:root {
    --primary-color: #8b0000;
    /* Dark red for button */
    --text-color: #000000;
    --bg-color: #ffffff;
    --font-hand: 'Patrick Hand', cursive;
    --font-display: 'Amatic SC', cursive;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    font-family: var(--font-hand);
    overflow: hidden;
    /* Prevent scrolling */
    background-color: var(--bg-color);
}

/* App Layout */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    z-index: 1;
}

header {
    padding: 20px;
    display: flex;
    justify-content: flex-end;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    padding: 10px;
}

/* Character Area */
.character-container {
    flex-grow: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
    /* We adhere to the "bottom" constraint of the image */
    margin-bottom: 10px;
    margin-top: 50px;
}

#character {
    width: 75%;
    height: 75%;
    /* Start with the idle image */
    background-image: url('assets/character_idle.jpg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom center;
    transition: background-image 0.2s ease;
}

/* Quote Display */
#quote-container {
	margin: auto;
    padding: 20px 20%;
    text-align: center;
    position: absolute;
    top: 10%;
    /* Positioned in the upper empty space */
    width: 100%;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#quote-container.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

#quote-text {
    font-size: 1.5rem;
    line-height: 1.4;
    color: var(--text-color);
    font-weight: 500;
    margin: 0;
    font-family: 'Times New Roman', cursive;
    /* More serif-like hand font */
}

/* Controls */
.controls {
    padding: 20px;
    display: flex;
    justify-content: center;
    background: transparent;
    padding-bottom: 40px;
}

#speak-btn {
    background-color: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}

#speak-btn:active {
    transform: scale(0.95);
}

/* Settings Overlay */
#settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 40px;
    transition: opacity 0.3s ease;
}

#settings-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
    /* simple hide for now */
}

.settings-content {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    font-size: 40px;
    cursor: pointer;
    color: #000;
}

h2 {
    font-family: 'Amatic SC', cursive;
    /* Uses serif-ish font from request 'Serif' but keeps hand vibe */
    font-size: 32px;
    margin-top: 40px;
    margin-bottom: 20px;
    font-weight: bold;
}

.setting-row {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-size: 24px;
    margin-top: 50px;
    cursor: pointer;
}

.language-option span {
    margin-left: 15px;
}

/* Custom Checkbox Circle */
.checkbox-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #ccc;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-circle.checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-circle.checked::after {
    content: '✓';
    color: white;
    font-size: 16px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    margin-left: auto;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

@media (max-width: 480px) {
  /* Character Area */
.character-container {
    flex-grow: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
    /* We adhere to the "bottom" constraint of the image */
    margin-bottom: 10px;
    margin-top: 50px;
	}

	#character {
    width: 80%;
    height: 80%;
    /* Start with the idle image */
    background-image: url('assets/character_idle.jpg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom center;
    transition: background-image 0.2s ease;
	}
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:checked+.slider:before {
    transform: translateX(22px);
}