@font-face {
    font-family: 'ImpressBT';
    src: url('img/fonts/ImpressBT.ttf') format('truetype');
}

@font-face {
    font-family: 'MinnieFont';
    src: url('img/fonts/MinnieFont.ttf') format('truetype');
}

@font-face {
    font-family: 'TTComic';
    src: url('img/fonts/Comic.ttf') format('truetype');
}

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

body {
    font-family: 'ImpressBT', 'Comic Sans MS', cursive, sans-serif;
    background: url('img/background.png') center center / cover no-repeat fixed;
    color: #3a2a00;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Clouds overlay on the background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url('img/loading_bg_clouds.png') center center / cover no-repeat;
    pointer-events: none;
    z-index: 0;
}

.container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Hero / Logo */
.hero {
    text-align: center;
    margin-bottom: 20px;
}

.hero-logo {
    width: 420px;
    height: 256px;
    object-fit: fill;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
    animation: logoFloat 3s ease-in-out infinite;
}

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

.subtitle {
    font-family: 'ImpressBT', sans-serif;
    color: #fff;
    font-size: 1.15rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7), 0 0 8px rgba(0,0,0,0.3);
    margin-top: 6px;
}

/* Panel — uses the Toontown green border panel as border-image */
.panel {
    position: relative;
    border: 36px solid transparent;
    border-image: url('img/tt_t_gui_ups_panelBg.png') 72 fill / 36px / 0 stretch;
    border-radius: 0;
    padding: 20px 24px;
    text-align: center;
    filter: drop-shadow(0 6px 20px rgba(0,0,0,0.4));
}

/* Buttons — Toontown style with bright colors and chunky borders */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border: 3px solid;
    border-radius: 12px;
    font-family: 'ImpressBT', 'Comic Sans MS', cursive;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.15s, filter 0.15s;
    width: 100%;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
    position: relative;
}

.btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    filter: brightness(1.1);
}

.btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    filter: brightness(0.95);
}

.btn-primary {
    background: linear-gradient(180deg, #4dc943 0%, #39a832 50%, #2d8a27 100%);
    border-color: #1e6b1a;
    color: #fff;
    font-size: 1.4rem;
    padding: 18px;
    box-shadow: 0 4px 0 #1a5c16, 0 6px 12px rgba(0,0,0,0.25);
}

.btn-primary:active {
    box-shadow: 0 1px 0 #1a5c16, 0 2px 4px rgba(0,0,0,0.25);
}

.btn-secondary {
    background: linear-gradient(180deg, #5bb8f5 0%, #3a8fd9 50%, #2d73b5 100%);
    border-color: #1d5a94;
    color: #fff;
    box-shadow: 0 3px 0 #174a7a, 0 4px 10px rgba(0,0,0,0.2);
}

.btn-secondary:active {
    box-shadow: 0 1px 0 #174a7a, 0 2px 4px rgba(0,0,0,0.2);
}

.btn-large { font-size: 1.5rem; padding: 18px; }

.hint {
    color: #6b5a30;
    font-size: 0.9rem;
    margin-top: 8px;
    font-family: 'ImpressBT', sans-serif;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #8a7a50;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 2px solid #c0b080;
}

.divider span {
    padding: 0 14px;
    font-size: 0.95rem;
    font-family: 'ImpressBT', sans-serif;
}

/* Google Sign-In button container */
.google-btn-container {
    width: 100%;
    display: flex;
    justify-content: center;
    min-height: 0;
}

/* Form elements */
.form-group h3 {
    margin-bottom: 14px;
    font-weight: 600;
    font-family: 'MinnieFont', 'ImpressBT', sans-serif;
    font-size: 1.3rem;
    color: #3a6e1e;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 10px;
    border: 3px solid #5ca83a;
    border-radius: 10px;
    background: #fff;
    color: #3a2a00;
    font-size: 1rem;
    font-family: 'ImpressBT', sans-serif;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.form-group input:focus {
    border-color: #39a832;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1), 0 0 0 3px rgba(77,201,67,0.3);
}

.form-group input::placeholder { color: #a09070; }

/* Links */
.switch-link {
    margin-top: 12px;
    font-size: 0.9rem;
    color: #6b5a30;
    font-family: 'ImpressBT', sans-serif;
}

.switch-link a {
    color: #2d73b5;
    text-decoration: none;
    font-weight: 600;
}

.switch-link a:hover { text-decoration: underline; }

/* Error */
.error {
    margin-top: 14px;
    padding: 12px;
    background: #fff0f0;
    border: 3px solid #e04040;
    border-radius: 10px;
    color: #b02020;
    font-size: 0.9rem;
    font-family: 'ImpressBT', sans-serif;
}

/* Loading spinner — Toontown style */
.spinner {
    width: 48px;
    height: 48px;
    border: 5px solid #c0e8b0;
    border-top-color: #39a832;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

#loading-text {
    font-family: 'ImpressBT', sans-serif;
    color: #3a6e1e;
    font-size: 1.1rem;
}

/* Game page overrides */
body.game-active { background: #000; overflow: hidden; }
body.game-active::before { display: none; }
body.game-active .container { display: none; }

#game-container {
    display: none;
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
}

body.game-active #game-container { display: block; }

#game-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#game-status {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-family: 'ImpressBT', monospace;
    font-size: 13px;
    background: rgba(0,0,0,0.7);
    padding: 6px 16px;
    border-radius: 8px;
    z-index: 10;
}
