* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    font-size: 20px;
}
body {
    background: #1a1a1a;
    color: #d4c5a9;
    font-family: Georgia, 'Times New Roman', serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}
.container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #4a3a2a;
    box-shadow: 0 0 20px rgba(0,0,0,0.7);
    padding: 25px 20px;
    border-radius: 6px;
    text-align: center;
}
h1, h2, h3 {
    color: #f0c040;
    text-shadow: 2px 2px 3px black;
    margin-bottom: 20px;
    letter-spacing: 1px;
}
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
p { margin: 12px 0; line-height: 1.5; }
a { color: #f0c040; text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; padding: 0; }

/* Общие стили для всех кнопок – без рамок */
button,
.btn,
input[type="submit"],
input[type="button"],
a.btn,
a.button,
.btn-sm {
    display: inline-block;
    width: auto;
    margin: 12px 5px;
    padding: 12px 18px;
    background: #2a2015;
    color: #d4c5a9;
    border: none;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 4px;
    text-shadow: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    transition: background 0.2s, color 0.2s;
    text-align: center;
    text-decoration: none;
    line-height: 1.4;
}
button:hover,
.btn:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
a.btn:hover,
a.button:hover,
.btn-sm:hover {
    background: #3a3020;
    color: #ffd700;
    text-decoration: none;
}
/* Кнопки во всю ширину в меню */
nav .btn {
    display: block;
    width: 100%;
    margin: 12px 0;
    padding: 16px 20px;
    font-size: 1.1rem;
}

input, textarea, select {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    background: #1e1e1e;
    border: 1px solid #4a3a2a;
    color: #d4c5a9;
    font-family: inherit;
    font-size: 1rem;
    border-radius: 4px;
    outline: none;
}
input:focus, textarea:focus, select:focus {
    border-color: #f0c040;
    box-shadow: 0 0 8px rgba(240,192,64,0.4);
}
label {
    display: block;
    margin: 5px 0;
    color: #c0a060;
    text-align: left;
}

.char-info {
    background: #1e1a12;
    border: 1px solid #4a3a2a;
    padding: 15px;
    margin: 15px 0;
    border-radius: 5px;
    text-align: center;
}
.char-info p { margin: 8px 0; }

.equipment-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 15px 0;
}
.equipment-slot {
    background: #1e1a12;
    border: 1px solid #4a3a2a;
    padding: 8px 12px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.slot-name {
    font-weight: bold;
    color: #d4c5a9;
    min-width: 80px;
}
.slot-item-link {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.85rem;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}
.slot-item-link:hover {
    text-decoration: underline;
    color: #ffd700;
}
.empty-slot {
    font-size: 0.8rem;
    color: #6a6a6a;
    font-style: italic;
}

.error {
    background: #3a1a1a;
    border: 1px solid #6a2a2a;
    color: #faa;
    padding: 12px;
    margin: 15px 0;
    border-radius: 5px;
    text-align: center;
}

.back-link {
    margin-top: 20px;
    display: inline-block;
}

.flex-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}
.flex-container form {
    flex: 1 1 250px;
    text-align: center;
}

.shop-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    justify-content: center;
}
.shop-controls a,
.shop-controls button {
    padding: 8px 14px;
    background: #2a2015;
    border: none;
    color: #d4c5a9;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
}
.shop-controls a.active,
.shop-controls button.active {
    background: #4a3a20;
    color: #ffd700;
}
.shop-item {
    background: #1e1a12;
    border: 1px solid #4a3a2a;
    padding: 12px;
    margin: 8px 0;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.shop-item-info {
    flex: 1;
}
.shop-item-name {
    font-weight: bold;
    font-size: 1.1rem;
}
.shop-item-desc {
    font-size: 0.9rem;
    color: #b0a080;
}
.shop-item-price {
    margin-top: 5px;
}
.shop-item-buy {
    margin-left: 15px;
}

/* Кнопки в магазине и инвентаре — без рамок, маленькие */
.shop-item-buy .btn,
.inventory-item .btn,
.item-detail .btn {
    padding: 5px 10px;
    font-size: 0.8rem;
    border: none;
    background: #2a2015;
    color: #d4c5a9;
    border-radius: 3px;
    min-width: auto;
}
.shop-item-buy .btn:hover,
.inventory-item .btn:hover,
.item-detail .btn:hover {
    background: #3a3020;
    color: #ffd700;
    border: none;
}

/* Цвета редкости */
.rarity-common { color: #9d9d9d; }
.rarity-rare { color: #4d94ff; }
.rarity-epic { color: #b366ff; }
.rarity-legendary { color: #ff8c00; }
.shop-item-name.rarity-common { color: #9d9d9d; }
.shop-item-name.rarity-rare { color: #4d94ff; }
.shop-item-name.rarity-epic { color: #b366ff; }
.shop-item-name.rarity-legendary { color: #ff8c00; }

/* Лор столицы */
.location-lore {
    background: #1e1a12;
    border: 1px solid #4a3a2a;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-style: italic;
}
.location-lore h2 {
    margin-top: 0;
}

/* Адаптация под мобильные */
@media (max-width: 600px) {
    html { font-size: 18px; }
    .container { padding: 15px; }
    button, .btn, .btn-sm { padding: 10px 14px; }
}

.slot-item-link {
    cursor: pointer;
}
