* {
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    margin: 0;
    min-height: 100vh;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #1e293b;
    background: #f5f7fb;
}

.page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.reg-form {
    width: 100%;
    max-width: 420px;
    padding: 36px 32px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.reg-form h1 {
    margin: 0 0 6px;
    font-size: 28px;
    text-align: center;
}

.reg-form  > div:first-child > p {
    margin: 0;
    font-size: 15px;
    color: #64748b;
    text-align: center;
}

.reg-form label {
    display: block;
    margin-bottom: 2px;
    font-weight: 600;
}

.reg-form input {
    width: 100%;
    padding: 8px 14px;
    font-size: 15px;
    color: #1e293b;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}

.reg-form input::placeholder {
    color: #94a3b8;
}

.reg-form input:hover {
    border-color: #94a3b8;
}

.reg-form input:focus {
    border-color: #4f46e5;
}

.auth-switch {
    margin: 4px 0 0 0;
    font-size: 14px;
    color: #64748b;
    text-align: center;
}

.auth-switch a {
    color: #4f46e5;
    font-weight: 600;
    text-decoration: none;
}

.auth-switch a:hover {
    color: #4338ca;
    text-decoration: underline;
}

.reg-form button {
    width: 100%;
    padding: 8px 14px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    background: #4f46e5;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.reg-form button:hover {
    background: #4338ca;
}

.reg-form button:active {
    background: #3730a3;
}

.reg-form button:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

.container {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 24px;
}

.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

.site-header .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    padding-top: 14px;
    padding-bottom: 14px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 24px;
}

.nav a {
    padding: 6px 0;
    font-size: 15px;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

.nav a:hover {
    color: #4f46e5;
}

.nav a.active {
    color: #4f46e5;
    font-weight: 600;
    border-bottom-color: #4f46e5;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.login-link {
    font-size: 15px;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    white-space: nowrap;
}

.login-link:hover {
    color: #4f46e5;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    color: #ffffff;
    background: #4f46e5;
    border: 1.5px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn:hover {
    background: #4338ca;
}

.btn:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

.btn-small {
    padding: 7px 12px;
    font-size: 13px;
}

.btn-outline {
    color: #4f46e5;
    background: #ffffff;
    border-color: #c7d2fe;
}

.btn-outline:hover {
    color: #4338ca;
    background: #eef2ff;
}

.site-main {
    flex: 1;
    width: 100%;
    padding: 36px 0 56px;
}

.page-title {
    margin: 0 0 6px;
    font-size: 30px;
    letter-spacing: -0.02em;
}

.page-subtitle {
    margin: 0 0 28px;
    font-size: 15px;
    color: #64748b;
}

.card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.hero {
    margin-bottom: 36px;
}

.hero h1 {
    margin: 0 0 10px;
    font-size: 32px;
    letter-spacing: -0.02em;
}

.hero p {
    max-width: 560px;
    margin: 0 0 22px;
    font-size: 15px;
    line-height: 1.6;
    color: #64748b;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-head h2 {
    margin: 0;
    font-size: 22px;
}

.section-head a {
    font-size: 14px;
    font-weight: 600;
    color: #4f46e5;
    text-decoration: none;
}

.section-head a:hover {
    color: #4338ca;
    text-decoration: underline;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 24px;
}

.chip {
    display: inline-block;
    padding: 0 0 3px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    text-decoration: none;
}

.chip:hover {
    color: #4f46e5;
}

.chip.active {
    color: #4f46e5;
    font-weight: 600;
    border-bottom-color: #4f46e5;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.game-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
}

.game-head h3 {
    margin: 0 0 3px;
    font-size: 17px;
}

.game-genre {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.game-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
}

.game-price {
    font-size: 17px;
    font-weight: 700;
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px;
    margin-bottom: 24px;
}

.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    font-size: 22px;
    font-weight: 600;
    color: #4f46e5;
    background: #eef2ff;
    border-radius: 50%;
}

.profile-info h2 {
    margin: 0 0 4px;
    font-size: 22px;
}

.profile-info p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
}

.profile-card .btn {
    margin-left: auto;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat {
    padding: 20px;
    text-align: center;
}

.stat strong {
    display: block;
    margin-bottom: 2px;
    font-size: 26px;
    color: #4f46e5;
}

.stat span {
    font-size: 14px;
    color: #64748b;
}

.library {
    padding: 24px;
}

.library h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.library-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
}

.library-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.library-item h3 {
    margin: 0 0 4px;
    font-size: 16px;
}

.library-item p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.hours {
    font-size: 14px;
    color: #64748b;
    white-space: nowrap;
}

.admin-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.panel {
    padding: 24px;
}

.panel h2 {
    margin: 0 0 18px;
    font-size: 20px;
}

.table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    font-size: 14px;
    border-collapse: collapse;
}

.admin-table th {
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid #e2e8f0;
}

.admin-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #f1f5f9;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-green {
    color: #15803d;
}

.badge-yellow {
    color: #a16207;
}

.badge-gray {
    color: #64748b;
}

.table-actions {
    display: flex;
    gap: 14px;
    white-space: nowrap;
}

.table-action {
    padding: 0;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #4f46e5;
    background: none;
    border: none;
    cursor: pointer;
}

.table-action:hover {
    text-decoration: underline;
}

.table-action-danger {
    color: #dc2626;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.admin-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
}

.admin-form input,
.admin-form select {
    width: 100%;
    padding: 9px 12px;
    font-family: inherit;
    font-size: 14px;
    color: #1e293b;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}

.admin-form input:focus,
.admin-form select:focus {
    border-color: #4f46e5;
}

.admin-form .btn {
    width: 100%;
    margin-top: 4px;
}

.site-footer {
    padding: 18px 0;
    font-size: 14px;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
}

.site-footer .container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

@media (max-width: 900px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .game-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nav {
        order: 3;
        width: 100%;
        gap: 18px;
        padding-bottom: 2px;
        overflow-x: auto;
    }

    .hero h1 {
        font-size: 30px;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 0 16px;
    }

    .game-grid {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 26px;
    }

    .stat {
        padding: 16px 8px;
    }

    .stat strong {
        font-size: 22px;
    }

    .stat span {
        font-size: 12px;
    }

    .profile-card {
        flex-wrap: wrap;
    }

    .profile-card .btn {
        margin-left: 0;
    }
}
