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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0a0a12;
    font-family: monospace;
    color: #ddd;
}

#viewport {
    width: 100%;
    height: 100%;
    position: relative;
}

#viewport canvas {
    display: block;
    image-rendering: pixelated;
}

/* ---- Auth & Character Select Screens ---- */

.screen-overlay {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 30%, rgba(60, 45, 20, 0.25) 0%, transparent 60%),
        radial-gradient(ellipse at center, #12101a 0%, #06050a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.screen-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../_flare_src/mods/fantasycore/images/menus/frame_background.png') center/cover no-repeat;
    opacity: 0.06;
    pointer-events: none;
}

.game-logo {
    width: 320px;
    max-width: 80vw;
    margin-bottom: 8px;
    image-rendering: auto;
    filter: drop-shadow(0 4px 20px rgba(180, 140, 60, 0.3));
}

.game-subtitle {
    font-family: monospace;
    font-size: 13px;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: #8a7a5a;
    margin-bottom: 28px;
    text-align: center;
}

.panel {
    background:
        linear-gradient(180deg, rgba(30, 25, 18, 0.97) 0%, rgba(15, 12, 20, 0.97) 100%);
    border: 1px solid rgba(180, 140, 80, 0.25);
    border-radius: 6px;
    padding: 36px 32px;
    width: 380px;
    max-width: 90vw;
    box-shadow:
        0 0 60px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(180, 140, 80, 0.08);
    position: relative;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(180, 140, 80, 0.4), transparent);
    border-radius: 6px 6px 0 0;
}

.panel h1 {
    text-align: center;
    color: #e8d8a0;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 22px;
    margin-bottom: 24px;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(180, 140, 60, 0.2);
}

.panel input[type="text"],
.panel input[type="password"] {
    width: 100%;
    padding: 11px 14px;
    margin-bottom: 10px;
    background: rgba(8, 6, 16, 0.7);
    border: 1px solid rgba(180, 140, 80, 0.15);
    border-radius: 4px;
    color: #d8d0b8;
    font-size: 14px;
    font-family: monospace;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.panel input::placeholder {
    color: #5a5040;
}

.panel input:focus {
    border-color: rgba(180, 140, 80, 0.45);
    box-shadow: 0 0 12px rgba(180, 140, 60, 0.1);
}

.panel button {
    width: 100%;
    padding: 11px;
    margin-top: 6px;
    background: linear-gradient(180deg, rgba(100, 80, 40, 0.6) 0%, rgba(60, 45, 20, 0.7) 100%);
    border: 1px solid rgba(180, 140, 80, 0.35);
    border-radius: 4px;
    color: #e8d8a0;
    font-size: 15px;
    font-weight: 600;
    font-family: monospace;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.15s;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.panel button:hover {
    background: linear-gradient(180deg, rgba(130, 105, 50, 0.7) 0%, rgba(80, 60, 30, 0.8) 100%);
    border-color: rgba(200, 160, 80, 0.5);
    box-shadow: 0 0 16px rgba(180, 140, 60, 0.15);
}

.panel button:active {
    transform: scale(0.98);
    background: linear-gradient(180deg, rgba(80, 60, 30, 0.8) 0%, rgba(50, 38, 15, 0.9) 100%);
}

.panel button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.switch-link {
    text-align: center;
    margin-top: 16px;
    color: #6a6050;
    font-size: 13px;
    font-family: monospace;
}

.switch-link a {
    color: #c4a860;
    text-decoration: none;
    transition: color 0.15s;
}

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

.error-msg {
    color: #cc6644;
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    font-family: monospace;
    min-height: 18px;
}

/* ---- Character List ---- */

#char-list {
    margin-bottom: 16px;
}

.char-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: rgba(8, 6, 16, 0.5);
    border: 1px solid rgba(180, 140, 80, 0.12);
    border-radius: 4px;
    transition: border-color 0.15s, background 0.15s;
}

.char-entry:hover {
    border-color: rgba(180, 140, 80, 0.3);
    background: rgba(40, 30, 15, 0.4);
}

.char-entry .char-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.char-entry .char-name {
    font-size: 15px;
    color: #e8d8a0;
    font-family: monospace;
    font-weight: bold;
    letter-spacing: 1px;
}

.char-entry .char-detail {
    font-size: 11px;
    color: #6a6050;
    font-family: monospace;
}

.char-entry button {
    width: auto;
    padding: 7px 22px;
    margin: 0;
    font-size: 13px;
}

#char-create-section {
    border-top: 1px solid rgba(180, 140, 80, 0.12);
    padding-top: 16px;
}

/* ---- Class Picker ---- */

#class-picker {
    display: flex;
    gap: 8px;
    margin: 10px 0;
}

.class-option {
    flex: 1;
    padding: 10px 6px;
    background: rgba(8, 6, 16, 0.5);
    border: 1px solid rgba(180, 140, 80, 0.12);
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}

.class-option:hover {
    border-color: rgba(180, 140, 80, 0.3);
    background: rgba(40, 30, 15, 0.4);
}

.class-option.selected {
    border-color: rgba(200, 160, 80, 0.6);
    background: rgba(60, 45, 20, 0.5);
    box-shadow: 0 0 10px rgba(180, 140, 60, 0.15);
}

.class-option .class-name {
    font-size: 14px;
    font-weight: bold;
    color: #e8d8a0;
    font-family: monospace;
    margin-bottom: 4px;
}

.class-option .class-desc {
    font-size: 9px;
    color: #6a6050;
    font-family: monospace;
    line-height: 1.3;
}

/* ---- Chat input (only HTML element in game UI) ---- */

#chat-input {
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 350px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(180, 140, 80, 0.2);
    border-radius: 4px;
    color: #e8d8a0;
    font-size: 13px;
    font-family: monospace;
    outline: none;
    z-index: 20;
    display: none;
}

#chat-input:focus {
    border-color: rgba(180, 140, 80, 0.45);
    background: rgba(0, 0, 0, 0.9);
}

/* ---- Version tag ---- */

.version-tag {
    position: absolute;
    bottom: 12px;
    font-family: monospace;
    font-size: 11px;
    color: #3a3528;
    letter-spacing: 1px;
}
