﻿/* === Global basics === */
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
    min-height: 100%;
    font-family: 'Inter', system-ui, Arial, sans-serif;
}

/* === Login page style (isolated) === */
body.page-login {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #081a37 url('/players/assets/ChatGPT%20Image%2026%20mar%202026,%2000_16_00.png') center/cover no-repeat;
    position: relative;
    color: #eaf2ff;
}

body.page-login::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(2, 8, 18, .68);
    z-index: -1;
}

.login-card {
    width: min(92vw, 540px);
    border-radius: 16px;
    padding: 26px;
    background: rgba(7, 13, 25, .83);
    border: 1px solid rgba(132, 176, 255, .42);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}

.login-card .card-header {
    margin-bottom: 16px;
}

.login-card .card-header h1 {
    margin: 0;
    font-size: 1.6rem;
    color: #f1f7ff;
}

.login-card .badge {
    color: #dbedff;
    background: rgba(13, 59, 123, .7);
    border: none;
}

.login-card label {
    display: block;
    color: #d9e8ff;
    font-size: 0.92rem;
    margin-bottom: 8px;
}

.login-card input {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(160, 184, 217, .5);
    background: rgba(255, 255, 255, .1);
    color: #f5fbff;
    margin-top: 4px;
}

.login-card input:focus {
    border-color: #5f99ff;
    box-shadow: 0 0 0 2px rgba(94, 145, 255, 0.3);
    outline: none;
}

.login-card button[type='submit'] {
    width: 100%;
    margin-top: 12px;
    background: #4f8af7;
    color: #fff;
    border: 1px solid #4d8fee;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
}

.login-card button[type='submit']:hover {
    background: #3b77e1;
}

.login-card a {
    color: #b8d4ff;
    text-decoration: none;
    font-size: .9rem;
}

.login-card p,
.login-card small {
    color: #c4d7f4;
}

/* === Dashboard layout (player) === */
.player-dashboard {
    background: #06122f;
    color: #dbe9ff;
    min-height: 100vh;
}

.dashboard-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 220px;
    background: linear-gradient(180deg, #0d1e45, #0b1738);
    border-right: 1px solid rgba(109, 166, 255, .33);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
}

.sidebar-brand h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #e3f0ff;
}

.sidebar-brand small {
    color: #91b8e8;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    align-items: flex-start;
}

.sidebar-btn {
    width: 100%;
    border: 1px solid rgba(70, 123, 227, .55);
    background: linear-gradient(180deg, rgba(31, 72, 144, .95), rgba(16, 36, 72, .9));
    color: #edf3ff;
    text-align: left;
    padding: 11px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: .95rem;
    transition: background 0.2s ease, transform 0.1s ease;
    box-shadow: 0 2px 7px rgba(15, 35, 70, 0.35);
}

.sidebar-btn:hover {
    background: linear-gradient(180deg, rgba(53, 108, 192, .98), rgba(26, 55, 103, .95));
    transform: translateY(-1px);
}

.sidebar-btn.active {
    background: linear-gradient(180deg, rgba(72, 137, 233, 1), rgba(39, 79, 147, 1));
    color: #fff;
    border: 1px solid rgba(125, 183, 255, 0.8);
}

.sidebar-subbtn {
    width: 100%;
    border: 1px solid rgba(138, 180, 255, .35);
    background: rgba(13, 29, 56, .94);
    color: #d4e9ff;
    text-align: left;
    padding: 8px 12px;
    border-radius: 7px;
    cursor: pointer;
    font-size: .90rem;
    transition: background 0.2s ease, transform 0.1s ease;
}

.sidebar-subbtn:hover {
    background: rgba(47, 92, 164, .92);
    transform: translateY(-1px);
}

.sidebar-subbtn.active {
    background: rgba(35, 76, 144, 1);
    border-color: rgba(115, 185, 255, .8);
    color: #fff;
}

.sidebar-games-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    margin-left: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s ease;
}

.sidebar-games-list.open {
    max-height: 300px;
}

.accordion-item {
    border: 1px solid rgba(149, 187, 255, .22);
    border-radius: 8px;
    overflow: hidden;
    backdrop-filter: blur(2px);
}

.accordion-header {
    width: 100%;
    border: none;
    background: rgba(27, 54, 96, .85);
    color: #dbeaff;
    text-align: left;
    padding: 8px 12px;
    cursor: pointer;
    font-size: .92rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-header:hover,
.accordion-header.active {
    background: rgba(53, 103, 181, .95);
    color: #fff;
}

.accordion-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.26s ease;
    background: rgba(20, 40, 74, .9);
    padding: 0 12px;
}

.accordion-panel.open {
    max-height: 200px;
    padding: 8px 12px 12px;
}

.sidebar-user-info {
    margin-bottom: 8px;
    background: rgba(19, 35, 63, .7);
    border: 1px solid rgba(120, 170, 250, .25);
    padding: 12px;
    border-radius: 10px;
    color: #e5efff;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-user-info strong {
    display: block;
    color: #eaf4ff;
    margin-bottom: 4px;
    font-weight: 700
}

.sidebar-user-info span {
    font-size: .85rem;
    color: #add2ff;
}

.sidebar-footer .btn-logout {
    width: 100%;
    background: #d77676;
    border: 1px solid #bf5f5f;
    color: #fff;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.sidebar-footer .btn-logout:hover {
    background: #c85f5f;
}

.dashboard-main {
    margin-left: 220px;
    min-height: 100vh;
    padding: 22px;
    overflow-x: hidden;
    overflow-y: auto;
    background: #0b1834;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.dashboard-header h1 {
    margin: 0;
    font-size: 1.45rem;
    color: #e7f2ff;
}

.dashboard-header .subtitle {
    color: #a5c2e7;
}

.dashboard-user {
    display: none;
}

.dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.widget {
    background: rgba(20, 40, 78, .78);
    border: 1px solid rgba(105, 163, 247, .22);
    border-radius: 12px;
    padding: 14px;
}

.widget h3 {
    margin: 0 0 8px;
    color: #b3c8f7;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-size: .82rem;
}

.widget p {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 700;
    color: #f1f8ff;
}

.dashboard-content {
    background: rgba(18, 41, 72, .8);
    border: 1px solid rgba(120, 177, 255, .2);
    border-radius: 12px;
    padding: 16px;
}

.dashboard-content h2 {
    margin: 0 0 12px;
    color: #dbecff;
}

.profile-info p,
.profile-change-password label {
    color: #dde9ff;
    margin: 8px 0 4px;
    font-size: .95rem;
}

.profile-info span {
    color: #f4fbff;
}

.profile-change-password input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(120, 170, 255, .3);
    border-radius: 6px;
    background: rgba(15, 28, 52, .95);
    color: #ecf3ff;
    margin-bottom: 10px;
}

.profile-change-password .btn-submit {
    background: linear-gradient(180deg, rgba(52, 154, 255, .95), rgba(22, 101, 215, .95));
    border: 1px solid rgba(110, 190, 255, .7);
    color: #fff;
    padding: 10px 12px;
    border-radius: 7px;
    cursor: pointer;
}

.profile-change-password .btn-submit:hover {
    background: linear-gradient(180deg, rgba(71, 188, 255, 1), rgba(30, 120, 245, 1));
}

.games-list {
    display: grid;
    gap: 10px;
}

.game-card {
    background: rgba(15, 30, 55, .95);
    border: 1px solid rgba(117, 168, 245, .24);
    border-radius: 10px;
    padding: 12px;
}

.game-card h4 {
    margin: 0;
    font-size: 1.02rem;
    color: #e8f0ff;
}

.game-card p {
    margin: 6px 0 0;
    color: #c6d6f2;
}

.character-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.character-card {
    perspective: 1000px;
    background: transparent;
    border: none;
    padding: 0;
}

.card-inner {
    position: relative;
    width: 100%;
    min-height: 170px;
    text-align: left;
    transition: transform 0.66s;
    transform-style: preserve-3d;
}

.character-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    min-height: 170px;
    top: 0;
    left: 0;
    backface-visibility: hidden;
    background: rgba(16, 32, 58, 0.95);
    border: 1px solid rgba(108, 170, 245, .35);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.card-front {
    position: relative;
}

.card-front,
.card-back {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.card-back {
    transform: rotateY(180deg);
}

.character-card .character-details,
.character-card .pet-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.character-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.character-card .character-details h4,
.character-card .pet-info h4 {
    margin: 0;
    font-size: 1.06rem;
    color: #eff6ff;
}

.character-card .character-details p,
.character-card .pet-info p {
    margin: 2px 0;
    color: #d4e5ff;
    font-size: 0.85rem;
}

.pet-detail-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
}

.pet-photo,
.character-photo {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    border: 1px solid rgba(130, 188, 255, 0.4);
    overflow: hidden;
    flex: 0 0 auto;
}

.pet-photo img,
.character-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.btn-view-pet,
.btn-back-to-character {
    margin-top: 10px;
    background: linear-gradient(180deg, rgba(73, 143, 247, 1), rgba(41, 94, 187, 1));
    border: 1px solid rgba(130, 190, 255, .9);
    color: #fff;
    border-radius: 8px;
    padding: 7px 10px;
    cursor: pointer;
    align-self: flex-start;
}

.btn-view-pet:hover,
.btn-back-to-character:hover {
    background: linear-gradient(180deg, rgba(95, 166, 255, 1), rgba(53, 114, 221, 1));
}

.pet-photo {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    border: 1px solid rgba(120, 185, 255, 0.35);
    overflow: hidden;
    flex: 0 0 auto;
}

.pet-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pet-info {
    flex: 1;
    display: grid;
    gap: 4px;
}

.btn-back-to-character {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(180deg, rgba(60, 120, 210, 1), rgba(40, 90, 180, 1));
    border: 1px solid rgba(124, 178, 251, 0.9);
}

.character-photo {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    border: 1px solid rgba(120, 185, 255, 0.35);
    background: #1d2f52;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.character-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.character-details h4 {
    margin: 0;
    font-size: 0.95rem;
    color: #e8f0ff;
}

.character-details p {
    margin: 2px 0;
    color: #d7e7ff;
    font-size: 0.84rem;
}

.pet-detail-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pet-photo {
    width: 90px;
    height: 90px;
    border-radius: 10px;
    border: 1px solid rgba(120, 185, 255, 0.35);
    overflow: hidden;
}

.pet-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pet-info {
    flex: 1;
    display: grid;
    gap: 4px;
}

.btn-view-pet,
.btn-view-sheet,
.btn-back-to-character {
    background: linear-gradient(180deg, rgba(70, 123, 227, 1), rgba(44, 84, 166, 1));
    border: 1px solid rgba(112, 180, 255, 0.9);
    color: #fff;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    margin-top: 8px;
    font-size: 0.84rem;
    box-shadow: 0 4px 12px rgba(18, 45, 88, 0.5);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn-view-pet:hover,
.btn-view-sheet:hover,
.btn-back-to-character:hover {
    background: linear-gradient(180deg, rgba(102, 164, 255, 1), rgba(57, 105, 205, 1));
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(19, 53, 108, 0.55);
}

.pet-loading,
.pet-panel {
    margin-top: 8px;
}

.btn-back-to-character {
    position: static;
    margin-top: 10px;
    align-self: start;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: rgba(11, 24, 52, 0.98);
    border: 1px solid rgba(96, 162, 255, 0.5);
    border-radius: 12px;
    width: min(800px, 95%);
    max-height: 90vh;
    overflow-y: auto;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
}

.modal-close {
    position: absolute;
    right: 16px;
    top: 16px;
    background: rgba(34, 74, 133, 0.92);
    border: 1px solid rgba(102, 158, 238, 0.4);
    border-radius: 50%;
    color: #fff;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 1.45rem;
    line-height: 0.9;
}

.modal h3 {
    margin-top: 0;
}

.modal .sheet-row {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
}

/* Utility */
.hidden {
    display: none !important;
}

.error {
    color: #ff9ea1;
}

.success {
    color: #7be2a2;
}

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