/* Общие фэнтези-настройки страницы и задний фон */
body {
    background-color: #1a0f0a;
    background-image: radial-gradient(circle, #2d1b13 0%, #0f0805 100%);
    color: #2b1a0a;
    font-family: "Georgia", "Times New Roman", serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    min-height: 100vh;
}

/* Навигационная панель / Шапка в стиле Dwar */
header {
    background: linear-gradient(to bottom, #422616 0%, #21120a 100%);
    border-bottom: 3px double #8c6939;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.logo {
    color: #f4e5c3;
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px #000;
}

.online-counter {
    background: #5c1306;
    color: #fff2cc;
    padding: 6px 12px;
    border-radius: 3px;
    border: 1px solid #d4af37;
    font-size: 14px;
    font-weight: bold;
}

/* Игровой двухколоночный макет */
.game-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Каменные пергаментные блоки */
.dwar-box {
    background: #f4e5c3;
    border: 4px double #8c6939;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), inset 0 0 30px rgba(139, 115, 85, 0.2);
    padding: 20px;
    border-radius: 4px;
    position: relative;
    height: fit-content;
}

.dwar-box::before {
    content: "";
    position: absolute;
    top: 2px; left: 2px; right: 2px; bottom: 2px;
    border: 1px solid #d4af37;
    pointer-events: none;
}

.dwar-box h1, .dwar-box h2, .dwar-box h3 {
    color: #5c1306;
    text-align: center;
    margin-top: 0;
    border-bottom: 1px dashed #8c6939;
    padding-bottom: 8px;
    text-transform: uppercase;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.dwar-box h1 {
    font-size: 22px;
}

/* Сетка для полей ввода (два столбца) */
.reg-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px 20px;
    margin-bottom: 15px;
}

.reg-field-full {
    margin-bottom: 20px;
}

.reg-fields-grid p, .reg-field-full p {
    margin: 0;
}

/* Стилизация текстовых полей (каменный стиль) */
input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    box-sizing: border-box;
    background: #fffbf0;
    border: 1px solid #705431;
    padding: 10px;
    font-size: 14px;
    color: #2b1a0a;
    border-radius: 3px;
    box-shadow: inset 1px 1px 4px rgba(0, 0, 0, 0.2);
    margin-top: 5px;
    font-family: "Georgia", serif;
}

input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.6), inset 1px 1px 4px rgba(0, 0, 0, 0.2);
}

label {
    font-weight: bold;
    font-size: 13px;
    color: #4a321a;
    display: block;
}

/* Ошибки валидации */
.error-msg {
    color: #bc1e1e;
    font-size: 13px;
    font-weight: bold;
    display: block;
    margin-top: 4px;
    min-height: 15px;
}

/* Фирменная зеленая кнопка Dwar */
.btn-reg {
    display: block;
    width: 100%;
    box-sizing: border-box;
    border: 2px solid #165c16;
    border-top-color: #5cee5c;
    border-bottom-color: #0d3a0d;
    color: #ffffff;
    padding: 12px;
    font-size: 15px;
    font-weight: bold;
    font-family: "Georgia", serif;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
    cursor: pointer;
    border-radius: 4px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-align: center;
    text-decoration: none;
    background: linear-gradient(to bottom, #34a834 0%, #1e731e 50%, #114d11 100%);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: transform 0.1s, filter 0.2s;
}

.btn-reg:hover { 
    filter: brightness(1.15); 
}

.btn-reg:active {
    background: linear-gradient(to bottom, #114d11 0%, #1e731e 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
    transform: translateY(1px);
}

/* Тексты сайдбара и ссылки */
.sidebar p {
    font-size: 13px;
    line-height: 1.5;
    color: #4a321a;
    margin: 8px 0;
}

.sidebar p.important {
    color: #5c1306;
    font-weight: bold;
}

.dwar-box a {
    color: #801c0c;
    font-weight: bold;
    text-decoration: none;
}

.dwar-box a:hover {
    color: #bd2c16;
}

/* Интерактивный холст создания персонажа */
#canvasReg {
    background: #fffbf0;
    border: 1px solid #705431;
    padding: 15px;
    text-align: center;
    border-radius: 3px;
    min-height: 250px;
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 1px 1px 4px rgba(0, 0, 0, 0.15);
}

#canvas_status {
    font-weight: bold;
    color: #4a321a;
    font-size: 14px;
}

/* Адаптивность для мобильных экранов */
@media (max-width: 768px) {
    .game-container { grid-template-columns: 1fr; }
    .reg-fields-grid { grid-template-columns: 1fr; gap: 10px; }
}
