/* ==========================================================================
   حرب الفرقين (Team War) — ستايل مستقل بالكامل (لا اعتماد على أي لعبة
   ثانية بالمنصة ولا على agp-game-shell.js). كل الألوان/القياسات مطابقة
   لمواصفات Figma اللي حددها أيمن بالتفصيل.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Zain:ital,wght@0,200;0,300;0,400;0,700;0,800;0,900;1,300;1,400&display=swap');

:root {
    --tw-bg-0: #161515;
    --tw-bg-1: #5D1112;
    --tw-blue: #134FBE;
    --tw-blue-dark: #092558;
    --tw-red: #E42528;
    --tw-red-dark: #5D1112;
    --tw-outer-border-1: #1F2F74;
    --tw-outer-border-2: #EF510E;
    --tw-banner-a: #134FBE;
    --tw-banner-b: #BE1316;
    --tw-gold: #FFD452;
    --tw-green: #1DB954;
    --tw-green-dark: #14813B;
    --tw-olive: #C9A227;
    --tw-olive-dark: #8A6F16;
    --tw-red-btn: #DC2626;
}

* { box-sizing: border-box; }

body.tw-active {
    background: linear-gradient(180deg, var(--tw-bg-0) 0%, var(--tw-bg-1) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    margin: 0;
    font-family: 'Zain', sans-serif;
    direction: rtl;
    color: #fff;
}

/* ---------- الهيدر الثابت ---------- */
#tw-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 9998; height: 60px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; box-sizing: border-box;
    background: linear-gradient(90deg, rgba(10,5,10,0.92), rgba(93,17,18,0.85));
    border-bottom: 2px solid var(--tw-red);
}
#tw-header-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
#tw-header-brand img { height: 40px; }
#tw-header-title { background: rgba(0,0,0,0.4); border-radius: 999px; padding: 6px 22px; color: #fff; font-weight: 800; font-size: 1em; }
.tw-header-icon-btn {
    width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--tw-blue);
    background: rgba(255,255,255,0.06); color: #fff; cursor: pointer; font-size: 1.15em;
    display: flex; align-items: center; justify-content: center; transition: transform .2s, background .2s;
}
.tw-header-icon-btn:hover { background: rgba(255,255,255,0.18); transform: rotate(35deg); }

/* ---------- الصندوق العام (إعدادات) ---------- */
#tw-overlay {
    position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
    padding: 90px 16px 20px; background: rgba(5,2,5,0.55);
}
#tw-box {
    width: 720px; max-width: 96vw; max-height: min(720px, 88vh); overflow-y: auto;
    background: rgba(30,15,20,0.66);
    border: 8px solid; border-image: linear-gradient(180deg, var(--tw-outer-border-1), var(--tw-outer-border-2)) 1;
    border-radius: 0; padding: 20px 30px; box-sizing: border-box;
    box-shadow: 0 0 50px rgba(0,0,0,0.6);
}
#tw-box h2 { margin: 0 0 14px; font-size: 1.5em; text-align: center; font-weight: 900; }

.tw-back-to-platform-link {
    display: block; margin: 0 0 10px auto; background: none; border: none; cursor: pointer;
    color: rgba(255,255,255,0.65); font-family: inherit; font-size: 0.85em; font-weight: 700;
    padding: 4px 0; transition: color .15s;
}
.tw-back-to-platform-link:hover { color: #fff; }

.tw-field { margin-bottom: 12px; text-align: right; }

/* صف اليوزر: مدخل + تسمية بنفس السطر، حد متدرّج مشترك */
.tw-row-field {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    border: 3px solid; border-image: linear-gradient(90deg, var(--tw-blue), var(--tw-red)) 1;
    border-radius: 10px; padding: 10px 16px; background: rgba(0,0,0,0.28);
}
.tw-row-field label { font-weight: 800; font-size: 1em; white-space: nowrap; }
.tw-row-field input[type=text] {
    flex: 1; padding: 9px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.18);
    background: rgba(0,0,0,0.4); color: #fff; font-family: inherit; font-size: 0.95em;
}
.tw-row-field input[type=text]::placeholder { color: rgba(255,255,255,0.45); }

.tw-section-header {
    text-align: center; font-weight: 800; padding: 10px 14px; margin-bottom: 14px;
    border: 3px solid; border-image: linear-gradient(90deg, var(--tw-blue), var(--tw-red)) 1;
    border-radius: 10px; background: rgba(0,0,0,0.28);
}

.tw-two-col { display: flex; gap: 14px; margin-bottom: 12px; }
.tw-two-col > div { flex: 1; }
.tw-team-box { border-radius: 10px; padding: 12px; border: 3px solid; text-align: center; }
.tw-team-box.tw-team-red { border-color: var(--tw-red); background: rgba(228,37,40,0.10); }
.tw-team-box.tw-team-blue { border-color: var(--tw-blue); background: rgba(19,79,190,0.10); }
.tw-team-box .tw-team-name-input {
    width: 100%; text-align: center; font-weight: 800; font-size: 1.05em; padding: 7px;
    border-radius: 8px; border: none; background: rgba(255,255,255,0.14); color: #fff; font-family: inherit; margin-bottom: 8px;
}
.tw-team-box.tw-team-red .tw-team-name-input { color: #ffd7d7; }
.tw-team-box.tw-team-blue .tw-team-name-input { color: #d7e4ff; }
.tw-team-box .tw-keyword-input {
    width: 100%; text-align: center; padding: 7px; border-radius: 8px; border: none;
    background: rgba(0,0,0,0.35); color: #fff; font-family: inherit; font-size: 0.9em;
}
.tw-team-box .tw-keyword-input::placeholder { color: rgba(255,255,255,0.55); }

.tw-pill-group { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.tw-pill-btn {
    border: 2px solid var(--tw-blue); background: rgba(19,79,190,0.25); color: #fff; border-radius: 999px;
    padding: 8px 18px; font-family: inherit; font-size: 0.95em; cursor: pointer; font-weight: 700; transition: all .15s;
}
.tw-pill-btn.tw-pill-active { background: var(--tw-blue); box-shadow: 0 0 12px rgba(19,79,190,0.8); }
.tw-field-label-center { text-align: center; font-weight: 700; margin-bottom: 8px; }

.tw-btn-connect {
    display: block; width: 100%; margin-top: 12px; padding: 14px; border: none; border-radius: 10px;
    background: linear-gradient(90deg, #1DB954, #14813B); color: #fff;
    font-family: inherit; font-weight: 900; font-size: 1.1em; cursor: pointer; transition: filter .15s;
}
.tw-btn-connect:hover { filter: brightness(1.1); }
.tw-btn-connect:disabled { opacity: 0.5; cursor: not-allowed; }
.tw-error-msg { color: #ffb4b4; font-size: 0.88em; margin: 8px 0; text-align: center; font-weight: 700; }
.tw-hint { color: #d8c3ec; font-size: 0.8em; margin-top: 6px; text-align: center; }

.tw-connecting-box { text-align: center; padding: 46px 10px; }
.tw-spinner { width: 48px; height: 48px; border: 4px solid rgba(255,255,255,0.2); border-top-color: var(--tw-blue); border-radius: 50%; margin: 0 auto 18px; animation: tw-spin 0.9s linear infinite; }
@keyframes tw-spin { to { transform: rotate(360deg); } }

/* ---------- اللوبي ---------- */
#tw-lobby-screen { padding: 100px 24px 30px; max-width: 1700px; margin: 0 auto; }
.tw-lobby-heading { text-align: center; font-size: 1.5em; font-weight: 800; color: #fff; margin: 0 0 16px; }
.tw-lobby-heading-accent { color: var(--tw-gold); font-weight: 900; }
.tw-lobby-banner {
    width: 100%; max-width: 1015px; margin: 0 auto 22px; padding: 22px 20px; text-align: center;
    font-size: 1.3em; font-weight: 800;
    background: linear-gradient(135deg, var(--tw-banner-a), var(--tw-banner-b));
    border: 3px solid; border-image: linear-gradient(135deg, var(--tw-banner-b), var(--tw-banner-a)) 1;
}
.tw-lobby-headers { display: flex; gap: 20px; max-width: 1650px; margin: 0 auto 6px; }
.tw-lobby-headers > div { flex: 1; }
.tw-team-header-box { border-radius: 10px; padding: 14px; text-align: center; border: 3px solid; }
.tw-team-header-box.tw-team-red { border-color: var(--tw-red); background: rgba(228,37,40,0.14); }
.tw-team-header-box.tw-team-blue { border-color: var(--tw-blue); background: rgba(19,79,190,0.14); }
.tw-team-header-name { font-size: 1.3em; font-weight: 900; margin-bottom: 4px; }
.tw-team-header-keyword { font-size: 0.95em; opacity: 0.85; }

.tw-lobby-panels { display: flex; align-items: center; gap: 16px; max-width: 1650px; margin: 10px auto 0; }
.tw-lobby-team-panel {
    flex: 1 1 0; min-width: 0; min-height: 400px; border-radius: 10px; border: 3px solid;
    padding: 20px; position: relative; box-sizing: border-box;
}
.tw-lobby-team-panel.tw-team-red {
    border-color: var(--tw-red);
    background: linear-gradient(160deg, var(--tw-red) 0%, var(--tw-red-dark) 72%, var(--tw-red-dark) 100%);
    background-blend-mode: normal; opacity: 0.97;
}
.tw-lobby-team-panel.tw-team-blue {
    border-color: var(--tw-blue);
    background: linear-gradient(160deg, var(--tw-blue) 0%, var(--tw-blue-dark) 72%, var(--tw-blue-dark) 100%);
    opacity: 0.97;
}
.tw-vs-label { font-size: 1.7em; font-weight: 900; color: var(--tw-red); text-shadow: 0 0 14px rgba(228,37,40,0.6); }

.tw-player-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tw-lobby-card-wrap { position: relative; }
.tw-lobby-remove-x {
    position: absolute; top: -8px; right: -8px; z-index: 2; width: 22px; height: 22px; border-radius: 50%;
    background: #ff2d2d; color: #fff; border: 2px solid #1a0a0a; font-size: 0.75em; font-weight: 900;
    display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.tw-player-card {
    background: #e9e6e6; border-radius: 999px; display: flex; align-items: center; justify-content: space-between;
    padding: 6px 8px 6px 14px; min-height: 46px;
}
.tw-player-card .tw-player-card-name { color: #241018; font-weight: 800; font-size: 0.95em; flex: 1; padding: 0 8px; word-break: break-word; }
.tw-player-card .tw-player-card-avatar { width: 34px; height: 34px; border-radius: 50%; background: #b7b3b3; object-fit: cover; flex-shrink: 0; }
.tw-lobby-empty-slot { border: 2px dashed rgba(255,255,255,0.35); border-radius: 999px; min-height: 46px; }
.tw-lobby-count { text-align: center; color: #fff; font-weight: 800; margin-bottom: 12px; font-size: 1.05em; text-shadow: 0 1px 4px rgba(0,0,0,0.5); }

.tw-lobby-btn-row { display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 26px; }
.tw-lobby-row-btn {
    width: 300px; max-width: 90vw; height: 48px; border: none; border-radius: 10px;
    font-family: inherit; font-weight: 800; font-size: 0.95em; cursor: pointer; color: #fff; transition: filter .15s;
}
.tw-lobby-row-btn:hover { filter: brightness(1.1); }
.tw-lobby-btn-settings { background: rgba(255,255,255,0.1); border: 2px solid rgba(255,255,255,0.35); }
.tw-lobby-btn-start { background: linear-gradient(90deg, #1DB954, #14813B); }
.tw-lobby-btn-start:disabled { opacity: 0.45; cursor: not-allowed; }
.tw-lobby-btn-platform { background: rgba(255,255,255,0.1); border: 2px solid rgba(255,255,255,0.35); }

/* ---------- لوحة إدارة المباراة (زر ⚙️) ---------- */
#tw-admin-panel {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 10000; width: 620px; max-width: 94vw;
    background: linear-gradient(160deg, #1a0a0a, var(--tw-bg-1));
    border-left: 3px solid var(--tw-red);
    padding: 70px 26px 26px; overflow-y: auto;
    transform: translateX(-100%); transition: transform .35s cubic-bezier(.2,.9,.3,1);
    box-shadow: 20px 0 50px rgba(0,0,0,0.5);
}
#tw-admin-panel.tw-panel-open { transform: translateX(0); }
.tw-admin-close-btn {
    position: absolute; top: 18px; left: 18px; width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255,255,255,0.08); border: 2px solid #ff4d4d; color: #ff4d4d; font-size: 1.3em; font-weight: 900;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.tw-admin-body { display: flex; gap: 18px; }
.tw-admin-buttons { display: flex; flex-direction: column; gap: 16px; width: 220px; flex-shrink: 0; justify-content: center; }
.tw-admin-btn {
    border-radius: 10px; padding: 13px 10px; font-family: inherit; font-weight: 800; font-size: 0.95em;
    cursor: pointer; text-align: center; border: 2px solid; color: #fff; transition: filter .15s;
}
.tw-admin-btn:hover:not(:disabled) { filter: brightness(1.15); }
.tw-admin-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.tw-admin-btn.tw-btn-team-blue { border-color: var(--tw-blue); background: rgba(19,79,190,0.35); }
.tw-admin-btn.tw-btn-team-red { border-color: var(--tw-red); background: rgba(228,37,40,0.35); }
.tw-admin-btn.tw-btn-end-match { border-color: var(--tw-olive); background: linear-gradient(90deg, var(--tw-olive), var(--tw-olive-dark)); }

.tw-admin-lists { flex: 1; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tw-admin-team-list { width: 100%; height: 387px; border-radius: 12px; border: 3px solid; overflow: hidden; display: flex; flex-direction: column; }
.tw-admin-team-list.tw-team-blue { border-color: var(--tw-blue); background: rgba(19,79,190,0.18); }
.tw-admin-team-list.tw-team-red { border-color: var(--tw-red); background: rgba(228,37,40,0.18); }
.tw-admin-team-list-title { text-align: center; font-weight: 900; padding: 10px; font-size: 1.05em; background: rgba(0,0,0,0.25); }
.tw-admin-team-list-body { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.tw-admin-player-row {
    position: relative; width: 100%; height: 85px; border-radius: 10px; background: rgba(20,10,10,0.75);
    display: flex; align-items: center; justify-content: space-between; padding: 0 18px;
}
.tw-admin-player-row .tw-player-card-name { font-weight: 800; font-size: 1.05em; color: #fff; }
.tw-admin-player-row .tw-player-card-avatar { width: 44px; height: 44px; border-radius: 50%; background: #b7b3b3; object-fit: cover; }
.tw-admin-remove-x {
    position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%;
    background: #ff2d2d; color: #fff; border: 2px solid #1a0a0a; font-size: 0.8em; font-weight: 900;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.tw-admin-empty { text-align: center; color: #d8c3ec; padding: 20px; font-size: 0.9em; }

/* اللوبي الفرعي (إضافة لاعب لمقعد فاضي) */
#tw-sub-lobby-overlay {
    position: fixed; inset: 0; z-index: 10001; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.55); opacity: 0; pointer-events: none; transition: opacity .25s;
}
#tw-sub-lobby-overlay.tw-sub-open { opacity: 1; pointer-events: auto; }
#tw-sub-lobby-box {
    width: 1015px; max-width: 94vw; min-height: 300px; border-radius: 10px; padding: 26px; position: relative;
    background: linear-gradient(135deg, #f26a6a, var(--tw-blue));
    border: 3px solid var(--tw-red); text-align: center;
    transform: scale(0.92); transition: transform .25s;
}
#tw-sub-lobby-overlay.tw-sub-open #tw-sub-lobby-box { transform: scale(1); }
.tw-sub-lobby-close {
    position: absolute; top: 12px; left: 12px; width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,0.2); border: 2px solid #fff; color: #fff; font-weight: 900; cursor: pointer;
}
.tw-sub-lobby-text { font-size: 1.2em; font-weight: 800; margin-bottom: 20px; }
.tw-sub-lobby-candidate { margin: 20px auto; }
.tw-sub-lobby-btn {
    padding: 12px 40px; border: none; border-radius: 10px; background: linear-gradient(90deg, #1DB954, #14813B);
    color: #fff; font-family: inherit; font-weight: 900; font-size: 1.05em; cursor: pointer; margin-top: 10px;
}
.tw-sub-lobby-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.tw-sub-lobby-waiting { color: rgba(255,255,255,0.85); font-size: 0.95em; }

/* ---------- شاشة اللعب (تصميم خاص، الشبكة والأدوار) ---------- */

/* شريط النقاط: رفيع، ملتصق بأعلى الشاشة تحت الهيدر مباشرة، ثابت مهما
   كبرت الشاشة أو تمددت (مش تبويب/صندوق كبير زي قبل) */
.tw-scorebar {
    position: fixed; top: 60px; left: 0; right: 0; z-index: 9997; height: 54px;
    display: flex; align-items: center; justify-content: center; gap: 28px;
    background: rgba(10,5,10,0.95); border-bottom: 2px solid var(--tw-red);
}
.tw-scorebar-team { display: flex; align-items: center; gap: 10px; }
.tw-scorebar-dot { width: 10px; height: 10px; border-radius: 50%; }
.tw-dot-blue { background: var(--tw-blue); }
.tw-dot-red { background: var(--tw-red); }
.tw-scorebar-name { font-size: 1em; font-weight: 800; color: #fff; }
.tw-scorebar-val {
    font-size: 1.7em; font-weight: 900; line-height: 1; padding: 3px 14px; border-radius: 8px;
    background: rgba(255,255,255,0.1);
}
.tw-val-blue { color: var(--tw-blue); text-shadow: 0 0 10px rgba(19,79,190,0.6); }
.tw-val-red { color: var(--tw-red); text-shadow: 0 0 10px rgba(228,37,40,0.6); }
.tw-scorebar-vs { font-size: 0.9em; color: var(--tw-gold); font-weight: 900; }

.tw-turn-indicator {
    position: fixed; top: 114px; left: 0; right: 0; z-index: 9996;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    text-align: center; padding: 6px 10px; background: rgba(0,0,0,0.5);
    font-size: 0.85em; font-weight: 700;
}
.tw-turn-timer { font-weight: 900; font-size: 1.2em; color: var(--tw-gold); margin-right: 8px; }
.tw-roster-turn-label { color: var(--tw-gold); font-weight: 900; }

#tw-match-screen { padding-top: 158px; padding-left: 20px; padding-right: 20px; padding-bottom: 40px; max-width: 1500px; margin: 0 auto; }

/* تخطيط ثلاثي: قائمة الفريق الأزرق | الشبكة | قائمة الفريق الأحمر */
.tw-match-body { display: flex; gap: 24px; align-items: flex-start; justify-content: center; }
.tw-roster { width: 230px; flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; }
.tw-roster-row {
    display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px;
    border: 2px solid transparent; transition: all .2s;
}
.tw-roster-blue .tw-roster-row { background: rgba(19,79,190,0.14); }
.tw-roster-red .tw-roster-row { background: rgba(228,37,40,0.14); }
.tw-roster-row.tw-roster-active {
    border-color: var(--tw-gold); box-shadow: 0 0 16px rgba(255,212,82,0.55);
    background: rgba(255,212,82,0.14);
}

.tw-grid { display: grid; grid-template-columns: repeat(8, 80px); grid-auto-rows: 80px; gap: 8px; }
.tw-tile {
    width: 80px; height: 80px; border-radius: 10px; position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.08); border: 2px solid rgba(255,255,255,0.3); color: #fff;
}
.tw-tile-icon-flag { position: absolute; inset: 0; opacity: 0.55; }
.tw-tile-icon-emoji { position: absolute; font-size: 2.1em; opacity: 0.4; }
.tw-tile-number {
    position: relative; font-size: 1.55em; font-weight: 900; color: #fff;
    text-shadow: 0 2px 6px rgba(0,0,0,0.9);
}
.tw-tile.tw-tile-used { background: rgba(0,0,0,0.45); border-color: rgba(255,255,255,0.08); }
.tw-tile.tw-tile-opening { animation: tw-tile-shrink .3s ease forwards; }
@keyframes tw-tile-shrink { to { transform: scale(0.7) rotateY(90deg); opacity: 0.3; } }

/* بطاقة الكشف: تنقلب وتكبر لـ250×250 بنص الشاشة */
.tw-card-reveal-overlay {
    position: fixed; inset: 0; z-index: 10500; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0); pointer-events: none; transition: background .25s;
}
.tw-card-reveal-overlay.tw-card-visible { background: rgba(0,0,0,0.65); }
.tw-card-reveal-box {
    width: 250px; height: 250px; padding: 20px; text-align: center; border-radius: 18px;
    background: linear-gradient(160deg, #2a0e14, #0d0508); border: 3px solid var(--tw-gold);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transform: scale(0.2) rotateY(180deg); opacity: 0; transition: transform .4s cubic-bezier(.2,.9,.3,1.4), opacity .3s;
}
.tw-card-reveal-overlay.tw-card-visible .tw-card-reveal-box { transform: scale(1) rotateY(0deg); opacity: 1; }
.tw-card-reveal-overlay.tw-card-closing .tw-card-reveal-box { transform: scale(0.2) rotateY(-180deg); opacity: 0; }
.tw-card-emoji { font-size: 3.6em; margin-bottom: 10px; }
.tw-card-value { font-size: 2em; font-weight: 900; }
.tw-card-value.tw-value-positive { color: #7CFC9A; }
.tw-card-value.tw-value-negative { color: #ff6b6b; }
.tw-card-effect-text { margin-top: 8px; font-size: 0.85em; opacity: 0.9; line-height: 1.4; }

/* غلاف بطاقة اللاعب المشتركة (agp-player-card.js) داخل شاشات اللعبة */
.tw-pcard-wrap { max-width: 100% !important; }

/* ---------- شاشة الفوز ---------- */
#tw-winner-screen {
    position: fixed; inset: 0; z-index: 10600; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(180deg, var(--tw-bg-0), var(--tw-bg-1));
}
#tw-winner-box {
    position: relative; width: 1645px; max-width: 95vw; min-height: 700px; padding: 60px 30px 30px;
    background: radial-gradient(ellipse at top, rgba(93,17,18,0.4), rgba(10,5,5,0.9));
    border: 3px solid var(--tw-gold); border-radius: 16px; text-align: center;
}
.tw-winner-crown-big { position: absolute; top: -55px; left: 50%; transform: translateX(-50%); width: 110px; }
.tw-winner-title { font-size: 1.8em; font-weight: 900; margin: 20px 0 30px; }
.tw-winner-cards { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-bottom: 30px; }
.tw-winner-card { width: 180px; height: 380px; display: flex; flex-direction: column; align-items: center; }
.tw-winner-card-crown { width: 44px; margin-bottom: 6px; }
.tw-winner-card-body {
    flex: 1; width: 100%; background: rgba(0,0,0,0.55); border-radius: 14px; border: 3px solid var(--tw-red);
    display: flex; flex-direction: column; align-items: center; padding: 18px 10px;
}
.tw-winner-card-avatar { width: 125px; height: 125px; border-radius: 50%; object-fit: cover; background: #333; margin-bottom: 14px; }
.tw-winner-card-name { color: #fff; font-weight: 900; font-size: 1.15em; margin-bottom: 8px; word-break: break-word; }
.tw-winner-card-points-label { color: var(--tw-gold); font-weight: 700; font-size: 0.85em; }
.tw-winner-card-points-val { color: var(--tw-gold); font-weight: 900; font-size: 1.3em; }

.tw-winner-buttons { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.tw-winner-btn { padding: 13px 26px; border-radius: 10px; border: none; color: #fff; font-family: inherit; font-weight: 800; cursor: pointer; font-size: 0.95em; }
.tw-winner-btn.tw-btn-restart { background: linear-gradient(90deg, #1DB954, #14813B); }
.tw-winner-btn.tw-btn-end { background: var(--tw-red-btn); }
.tw-winner-btn.tw-btn-newmatch { background: linear-gradient(90deg, var(--tw-olive), var(--tw-olive-dark)); }
