/* =========================================================================
   БОНУСНЫЕ БАЛЛЫ — ретро Win-стиль (общая концепция VATARA)
   Общий стиль для index / login / dashboard / admin. Фон: bonusbg.png.
   ========================================================================= */

:root {
    --cream:  #f7eed6;
    --navy:   #23315e;
    --denim:  #34508f;
    --green:  #58b558;
    --purple: #9146ff;
    --yellow: #ffd56b;
    --pink:   #f4afc4;
    --pinkdeep: #c43d72;
    --cur: url(cursor.png) 0 0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }

body {
    min-height: 100vh;
    font-family: 'Pixelify Sans', monospace;
    color: var(--navy);
    line-height: 1.4;
    padding: 26px 18px 44px;
    background: #2a6fd0 url("bonusbg.png") center center / cover no-repeat fixed;
    cursor: var(--cur), auto;
}
img { image-rendering: pixelated; }
::selection { background: var(--green); color: #0e2c10; }

/* ---- НАСЛОЕНИЯ ---- */
.scrim { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.scrim-dark { background: linear-gradient(160deg, rgba(10,14,34,.5), rgba(10,14,34,.66)); }
.scrim-vignette { background: radial-gradient(circle at 50% 42%, rgba(0,0,0,0) 46%, rgba(8,12,30,.5) 100%); }
.scanlines {
    background: repeating-linear-gradient(to bottom, rgba(0,0,0,.2) 0 1px, rgba(255,255,255,0) 1px 3px);
    mix-blend-mode: overlay; animation: flicker 4s ease-in-out infinite;
}
.top-strip { position: fixed; top: 0; left: 0; right: 0; height: 6px; z-index: 40; background: rgba(16,18,40,.6); overflow: hidden; }
.top-strip i {
    position: absolute; top: 0; height: 100%; width: 38%; left: -42%;
    background: linear-gradient(90deg, var(--green), var(--yellow));
    box-shadow: 0 0 12px rgba(255,213,107,.75); animation: loadbar 2.6s linear infinite;
}
.float { position: fixed; z-index: 1; pointer-events: none; width: 24px; }
.float.heart { filter: drop-shadow(0 0 8px rgba(244,175,196,.7)); animation: floaty 6s ease-in-out infinite; }
.float.spark { filter: drop-shadow(0 0 8px rgba(255,213,107,.7)); animation: twinkle 3.2s ease-in-out infinite; }

/* ---- КОМПОНОВКА ---- */
.container { position: relative; z-index: 2; max-width: 1000px; margin: 0 auto; display: grid; gap: 16px; }
.container.wide { max-width: 1340px; }

/* ---- ОКНО ---- */
.card, header.hero {
    background: rgba(247,238,214,.95);
    border: 3px solid; border-top-color: #fff8ea; border-left-color: #fff8ea;
    border-right-color: #8d7a4e; border-bottom-color: #8d7a4e;
    box-shadow: 6px 6px 0 rgba(18,20,40,.4);
}
.titlebar {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 7px 9px; background: linear-gradient(180deg, #3f5ba0, #2c477f);
    border-bottom: 2px solid #22376b;
}
.tb-title {
    display: flex; align-items: center; gap: 9px;
    font-family: 'Pixelify Sans'; font-size: 18px; letter-spacing: 1px; color: #faf3e2;
    text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.tb-ico {
    width: 16px; height: 13px; flex: none; display: inline-block;
    background: linear-gradient(180deg, var(--yellow), #e7b73e);
    border: 2px solid; border-top-color: #fff2c4; border-left-color: #fff2c4;
    border-right-color: #a87d18; border-bottom-color: #a87d18;
}
.tb-btns { display: flex; gap: 5px; }
.tb-btns i {
    width: 18px; height: 16px; display: flex; align-items: center; justify-content: center;
    font-style: normal; font-size: 11px; color: #3a3120; background: #d9cba6;
    border: 2px solid; border-top-color: #fff8ea; border-left-color: #fff8ea;
    border-right-color: #8d7a4e; border-bottom-color: #8d7a4e;
}
.win-body { padding: 22px; }

/* ---- ШАПКА ---- */
.hero-body { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 6px; font-family: 'Press Start 2P'; font-size: 11px; letter-spacing: 2px; color: var(--purple); text-transform: uppercase; }
h1 { font-family: 'Pixelify Sans'; font-weight: 700; font-size: clamp(1.5rem, 4vw, 2.1rem); color: var(--navy); line-height: 1.1; text-shadow: 2px 2px 0 rgba(244,175,196,.5); }
h2, .section-title { font-family: 'Pixelify Sans'; font-weight: 700; font-size: clamp(1.05rem, 2.4vw, 1.3rem); color: var(--navy); margin-bottom: 16px; }
.subtitle, .muted-text { color: #495491; font-size: 16px; margin-top: 6px; }

/* ---- КНОПКИ ---- */
.btn, .twitch-btn, .back-link, .logout-btn, .page-btn, .submit-btn, .amount-btn, button.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    font-family: 'Pixelify Sans'; font-weight: 600; font-size: 17px; letter-spacing: .5px; line-height: 1;
    color: #1f2c54; background: rgba(250,243,226,.96); text-decoration: none; padding: 10px 16px;
    border: 3px solid; border-top-color: #fff8ea; border-left-color: #fff8ea;
    border-right-color: #b9a778; border-bottom-color: #b9a778;
    cursor: var(--cur), pointer;
}
.btn:hover, .back-link:hover, .logout-btn:hover, .page-btn:hover {
    color: #faf3e2; background: var(--denim);
    border-top-color: #5e79b8; border-left-color: #5e79b8;
    border-right-color: #22376b; border-bottom-color: #22376b;
}
.btn:active, .twitch-btn:active, .page-btn:active, .submit-btn:active, .amount-btn:active { transform: translate(1px, 1px); }
.btn-ghost { background: rgba(52,80,143,.14); }

/* Twitch (фиолетовая) */
.twitch-btn {
    color: #fff; background: var(--purple); font-weight: 700;
    border-top-color: #c7a8ff; border-left-color: #c7a8ff;
    border-right-color: #5b27b0; border-bottom-color: #5b27b0;
}
.twitch-btn:hover { background: #9d57ff; color: #fff; }
.twitch-btn svg { width: 20px; height: 20px; fill: currentColor; }

/* Розовая (списать / отправить) */
.submit-btn, .btn-pink {
    color: #fff; background: var(--pinkdeep); font-weight: 700; width: 100%;
    border-top-color: #f0a3c4; border-left-color: #f0a3c4;
    border-right-color: #8e2950; border-bottom-color: #8e2950;
    padding: 14px 24px; font-size: 18px;
}
.submit-btn:hover, .btn-pink:hover { background: #d6588c; color: #fff; }
.submit-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- ФОРМЫ ---- */
.form-group { margin-bottom: 18px; }
label { display: block; color: #495491; font-size: 15px; margin-bottom: 8px; letter-spacing: .5px; }
input, textarea, select {
    width: 100%; font-family: 'Pixelify Sans'; font-size: 17px; color: var(--navy);
    background: #fffdf6; padding: 11px 13px;
    border: 3px solid; border-top-color: #8d7a4e; border-left-color: #8d7a4e;
    border-right-color: #fff8ea; border-bottom-color: #fff8ea;
    outline: none;
}
input:focus, textarea:focus, select:focus { box-shadow: inset 0 0 0 2px rgba(88,181,88,.5); }
textarea { resize: vertical; min-height: 96px; }
select { cursor: var(--cur), pointer; }

/* ---- СТАТИСТИКА ---- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat-card {
    text-align: center; padding: 18px 14px; background: rgba(255,253,246,.6);
    border: 3px solid; border-top-color: #8d7a4e; border-left-color: #8d7a4e;
    border-right-color: #fff8ea; border-bottom-color: #fff8ea;
}
.stat-value { font-family: 'Press Start 2P'; font-size: clamp(1.1rem, 3vw, 1.6rem); color: var(--pinkdeep); }
.stat-label { font-size: 14px; color: #56608c; margin-top: 10px; }

/* ---- БАЛАНС ---- */
.balance-card { text-align: center; padding: 36px 20px; }
.balance-label { color: #56608c; font-size: 15px; text-transform: uppercase; letter-spacing: 3px; margin-bottom: 14px; }
.balance-amount { font-family: 'Press Start 2P'; font-size: clamp(2.2rem, 8vw, 3.6rem); color: var(--pinkdeep); line-height: 1.1; text-shadow: 3px 3px 0 rgba(244,175,196,.45); }

/* ---- ТАБЛИЦЫ ---- */
table { width: 100%; border-collapse: separate; border-spacing: 0; border: 2px solid #8d7a4e; background: rgba(255,253,246,.5); }
th, td { padding: 12px 14px; text-align: left; }
th {
    background: linear-gradient(180deg, #3f5ba0, #2c477f); color: #faf3e2;
    font-family: 'Pixelify Sans'; font-weight: 600; font-size: 15px; letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0,0,0,.4); border-bottom: 2px solid #22376b;
}
td { border-top: 1px solid rgba(141,122,78,.3); font-size: 17px; color: var(--navy); }
tbody tr:nth-child(even) td { background: rgba(52,80,143,.07); }
tbody tr:hover td { background: rgba(52,80,143,.16); }
.place { font-family: 'Pixelify Sans'; font-weight: 700; font-size: 18px; color: var(--pinkdeep); width: 60px; }
.username { font-weight: 600; }
.balance { font-family: 'Pixelify Sans'; font-weight: 700; font-size: 18px; color: var(--pinkdeep); text-align: right; }

/* ---- ПАГИНАЦИЯ ---- */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.page-btn.active { color: #fff; background: var(--pinkdeep); border-top-color: #f0a3c4; border-left-color: #f0a3c4; border-right-color: #8e2950; border-bottom-color: #8e2950; }
.page-btn.disabled { opacity: .4; pointer-events: none; }

/* ---- АЛЕРТЫ ---- */
.alert, .error {
    padding: 12px 15px; margin-bottom: 16px; font-size: 16px;
    border: 2px solid;
}
.alert-success { color: #1f6b3a; background: rgba(88,181,88,.22); border-top-color: #b6e3b6; border-left-color: #b6e3b6; border-right-color: #357a35; border-bottom-color: #357a35; }
.alert-error, .error { color: #8c1f30; background: rgba(244,175,196,.4); border-top-color: #f7c9d6; border-left-color: #f7c9d6; border-right-color: #c77086; border-bottom-color: #c77086; }

/* ---- ПУСТО ---- */
.empty-state { text-align: center; padding: 40px 16px; color: #56608c; font-size: 17px; }
.empty-state p + p { margin-top: 8px; }

/* ---- ТРАТА БАЛЛОВ ---- */
.amount-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.amount-btn { font-family: 'Press Start 2P'; font-size: 14px; padding: 14px 12px; }
.amount-btn.selected { color: #fff; background: var(--pinkdeep); border-top-color: #f0a3c4; border-left-color: #f0a3c4; border-right-color: #8e2950; border-bottom-color: #8e2950; }
.amount-btn.disabled, .amount-btn:disabled {
    opacity: .45; cursor: not-allowed; color: #7a82a8; background: #efe7d2;
    border-top-color: #8d7a4e; border-left-color: #8d7a4e; border-right-color: #cdbf99; border-bottom-color: #cdbf99;
}
#selectedAmountText { color: var(--pinkdeep); margin-top: 12px; font-weight: 700; font-size: 16px; }

/* ---- ЛИЧНЫЙ КАБИНЕТ ---- */
.user-info { display: flex; align-items: center; gap: 14px; }
.user-avatar {
    width: 50px; height: 50px; object-fit: cover; background: var(--denim);
    border: 3px solid; border-top-color: #fff8ea; border-left-color: #fff8ea;
    border-right-color: #8d7a4e; border-bottom-color: #8d7a4e;
}
.user-name { font-family: 'Pixelify Sans'; font-weight: 700; font-size: 19px; }
.header-links { display: flex; gap: 9px; flex-wrap: wrap; }
.history-list { list-style: none; }
.history-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid rgba(141,122,78,.3); }
.history-item:last-child { border-bottom: none; }
.history-info h4 { font-size: 17px; margin-bottom: 4px; font-weight: 600; }
.history-info .date { font-size: 13px; color: #7a82a8; }
.history-amount { font-family: 'Pixelify Sans'; font-weight: 700; font-size: 18px; color: var(--pinkdeep); white-space: nowrap; }

/* ---- ЛОГИН-КАРТА ---- */
.login-wrap { min-height: calc(100vh - 70px); display: flex; align-items: center; justify-content: center; }
.login-card { position: relative; z-index: 2; width: min(420px, 100%); }
.login-card .win-body { padding: 36px 32px; text-align: center; }
.login-card h1 { margin-bottom: 10px; }
.login-card .lead { color: #495491; margin-bottom: 24px; font-size: 16px; }
.login-card .twitch-btn { font-size: 18px; padding: 14px 26px; }
.info-text { margin-top: 26px; font-size: 14px; color: #56608c; }

/* ---- АДМИНКА ---- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.full-width { grid-column: 1 / -1; }
.big-number { font-family: 'Press Start 2P'; font-size: 1.4rem; color: var(--pinkdeep); }
.admin-stat-line { font-size: 17px; margin-top: 10px; }
.admin-stat-line:first-child { margin-top: 0; }
.search-box { display: flex; gap: 10px; margin-bottom: 14px; }
.search-box input { flex: 1; }
.search-box button { width: auto; padding: 11px 18px; }
.user-list {
    max-height: 200px; overflow-y: auto; margin-bottom: 14px; background: #fffdf6;
    border: 3px solid; border-top-color: #8d7a4e; border-left-color: #8d7a4e;
    border-right-color: #fff8ea; border-bottom-color: #fff8ea;
}
.user-item { padding: 10px 12px; border-bottom: 1px solid rgba(141,122,78,.3); cursor: var(--cur), pointer; font-size: 16px; }
.user-item:hover { background: rgba(52,80,143,.14); }
.user-item.selected { background: var(--pinkdeep); color: #fff; }
.btn-approve { color: #0e2c10; background: var(--green); border-top-color: #9ae39a; border-left-color: #9ae39a; border-right-color: #357a35; border-bottom-color: #357a35; padding: 7px 13px; font-size: 15px; }
.btn-reject { color: #fff; background: var(--pinkdeep); border-top-color: #f0a3c4; border-left-color: #f0a3c4; border-right-color: #8e2950; border-bottom-color: #8e2950; padding: 7px 13px; font-size: 15px; }
.btn-primary { color: #faf3e2; background: var(--denim); border-top-color: #5e79b8; border-left-color: #5e79b8; border-right-color: #22376b; border-bottom-color: #22376b; }
.inline-actions { display: flex; gap: 6px; }
.checkbox-row { display: flex; align-items: center; gap: 9px; margin: 12px 0; color: #495491; font-size: 15px; }
.checkbox-row input { width: auto; }
.status-pending { color: #b07d12; } .status-approved { color: #1f6b3a; } .status-rejected { color: #8c1f30; }

/* ---- АНИМАЦИИ ---- */
@keyframes loadbar { 0% { left: -42%; } 100% { left: 112%; } }
@keyframes flicker { 0%, 100% { opacity: .5; } 50% { opacity: .34; } }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-16px) rotate(8deg); } }
@keyframes twinkle { 0%, 100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.2); } }

/* ---- АДАПТИВ ---- */
@media (max-width: 900px) {
    .grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .stats { grid-template-columns: 1fr; }
    .hero-body { flex-direction: column; align-items: flex-start; }
    .balance-amount { font-size: 2.4rem; }
    table { display: block; overflow-x: auto; white-space: nowrap; }
}
