/* ============================================================
   Thème pour la section Tournois — repris fidèlement du thème
   "Windows XP / Internet Explorer 6" utilisé sur le reste du site
   (party/static/party/css/xp.css) : même dégradé de barre de
   titre, même beige de fenêtre, mêmes boutons gris 3D, même
   police Tahoma. Seul ajout propre à cette section : un "bureau"
   Windows en fond (recréé en CSS) avec sa barre des tâches.
   ============================================================ */

* {
    box-sizing: border-box;
}

.term-body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 78% 14%, #fff6c2 0%, #fff6c2 34px, rgba(255,246,194,0.25) 46px, transparent 60px),
        linear-gradient(180deg, #2f7bd6 0%, #63a9ec 45%, #bfe3f8 78%, #d8f0fb 100%);
    color: #000;
    font-family: Tahoma, Geneva, Verdana, sans-serif;
    font-size: 13px;
    line-height: 1.5;
    padding: 16px 12px 66px;
    -webkit-text-size-adjust: 100%;
    position: relative;
    overflow-x: hidden;
}
.term-body::before,
.term-body::after {
    content: "";
    position: fixed;
    left: -15%;
    right: -15%;
    bottom: 40px;
    height: 34vh;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    z-index: 0;
    pointer-events: none;
}
.term-body::before {
    bottom: 30px;
    height: 30vh;
    background: linear-gradient(180deg, #3f9b3f, #2e7d2e);
    opacity: 0.85;
}
.term-body::after {
    bottom: 40px;
    height: 22vh;
    background: linear-gradient(180deg, #63c463, #3f9b3f);
}

/* ---------- Fenêtre (identique à .ie-window du site principal) ---------- */

.term-window {
    max-width: 820px;
    margin: 0 auto;
    background: #ece9d8;
    border: 1px solid #0a246a;
    box-shadow: 3px 3px 10px rgba(0,0,0,.5);
    position: relative;
    z-index: 2;
    transition: max-width 0.2s ease, margin 0.2s ease;
}

.term-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 6px;
    background: linear-gradient(180deg, #2657d6 0%, #3d7cf4 8%, #2657d6 40%, #1941c9 60%, #123fae 100%);
    color: #fff;
    font-weight: bold;
    font-size: 12px;
    text-shadow: 1px 1px 1px rgba(0,0,0,.4);
    user-select: none;
    gap: 10px;
    flex-wrap: wrap;
}
.term-topbar .term-title {
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.5px;
}

/* Barre secondaire (liens de nav), façon barre de menus IE */
.term-topbar + .term-topbar {
    background: #ece9d8;
    border-bottom: 1px solid #b9b6a3;
    padding: 4px 8px;
}

.term-window-buttons {
    display: flex;
    gap: 2px;
}
.term-window-buttons button {
    width: 22px;
    height: 20px;
    background: linear-gradient(180deg,#5b8ff0,#1a45c0);
    border: 1px solid #0a246a;
    border-radius: 2px;
    color: #fff;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.term-window-buttons button:active {
    filter: brightness(0.85);
}
.term-window-buttons button.term-win-close {
    background: linear-gradient(180deg,#f0736b,#c21b0e);
    color: #fff;
}

.term-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 11px;
}
.term-nav a {
    color: #000;
    text-decoration: none;
    background: linear-gradient(180deg,#fdfdfd 0%,#ece9d8 45%,#d9d6c3 55%,#c9c6b1 100%);
    border: 1px solid #8f8b76;
    padding: 4px 10px;
    white-space: nowrap;
}
.term-nav a:active {
    background: linear-gradient(180deg,#c9c6b1,#ece9d8);
}

h1.term-h1 {
    font-size: 20px;
    font-family: "Comic Sans MS", "Comic Sans", cursive;
    margin: 4px 0 4px;
    color: #123fae;
    text-align: center;
}

.term-subtitle {
    color: #555;
    font-size: 12px;
    margin-bottom: 16px;
    text-align: center;
    font-style: italic;
}

.term-divider {
    border: none;
    border-top: 1px solid #b9b6a3;
    margin: 16px 0;
}

.term-cursor::after {
    content: "";
}

/* ---------- Contenu principal (blanc, comme .ie-content) ---------- */

.term-content-wrap {
    background: #fff;
    padding: 18px 20px 22px;
    min-height: 320px;
    border-bottom: 1px solid #b9b6a3;
}

/* ---------- Boîtes / panneaux ---------- */

.term-box {
    border: 1px solid #7f9db9;
    background: #f4f6fb;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.term-box-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: #123fae;
    font-size: 13px;
}

.term-game-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.term-game-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    border: 1px solid #7f9db9;
    padding: 10px 12px;
    background: #fff;
}

.term-game-name {
    font-weight: bold;
    font-size: 14px;
    color: #123fae;
}

.term-status-tag {
    font-size: 11px;
    font-weight: bold;
    padding: 2px 8px;
    border: 1px solid #7f9db9;
}
.term-status-tag.open { color: #0a5d1f; background: #d9f2df; }
.term-status-tag.closed { color: #7a5c00; background: #fff2c2; }
.term-status-tag.generated { color: #0a3f8f; background: #d9e8ff; }

/* ---------- Boutons : identiques aux .xp-button du site principal ---------- */

.term-button {
    display: inline-block;
    font-family: Tahoma, sans-serif;
    font-size: 12px;
    background: linear-gradient(180deg,#fdfdfd 0%,#ece9d8 45%,#d9d6c3 55%,#c9c6b1 100%);
    color: #000;
    border: 1px solid #003c74;
    border-radius: 3px;
    padding: 9px 18px;
    min-height: 40px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: inset 0 1px 0 #fff;
    font-weight: normal;
}
.term-button:active {
    background: linear-gradient(180deg,#c9c6b1,#ece9d8);
    box-shadow: none;
}
.term-button.secondary {
    background: linear-gradient(180deg,#eef4ff,#cfe0f7 45%,#a9c6ea 55%,#8fb3de 100%);
    border-color: #003c74;
}
.term-button.secondary:active {
    background: linear-gradient(180deg,#8fb3de,#cfe0f7);
}
.term-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* ---------- Formulaires ---------- */

.term-fieldset {
    border: 1px solid #7f9db9;
    padding: 12px 16px 16px;
    margin-bottom: 14px;
}
.term-fieldset legend {
    font-weight: bold;
    color: #123fae;
    padding: 0 6px;
    font-size: 12px;
}
.term-row {
    margin-bottom: 10px;
}
.term-row label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: #333;
}
.term-input, select.term-input, textarea.term-input {
    width: 100%;
    font-family: Tahoma, sans-serif;
    font-size: 13px;
    border: 1px solid #7f9db9;
    box-shadow: inset 1px 1px 2px rgba(0,0,0,.3);
    padding: 8px 8px;
    min-height: 40px;
    background: #fff;
    color: #000;
}
.term-input:focus {
    outline: 1px dotted #123fae;
    outline-offset: 1px;
}
.term-checkbox-group label,
.term-radio-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
}
.term-checkbox-group input,
.term-radio-group input {
    margin-right: 8px;
    transform: scale(1.15);
}

.term-error-box {
    border: 1px solid #0a246a;
    background: #ece9d8;
    color: #000;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 13px;
}
.term-error-box::before {
    content: "⚠️ ";
}

/* ---------- Tableau (arbre) : boîtes claires façon fenêtre XP ---------- */

.term-bracket-tree-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 4px 24px;
}
.bracket-node {
    display: flex;
    align-items: center;
    gap: 20px;
}
.bracket-children {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 16px;
    border-right: 2px dashed #7f9db9;
    padding-right: 20px;
}
.bracket-branch {
    display: flex;
}
.bracket-match-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.bracket-round-tag {
    font-size: 10px;
    font-weight: bold;
    color: #123fae;
    text-transform: uppercase;
}

.term-tree-match {
    width: 200px;
    border: 1px solid #7f9db9;
    background: #fff;
    font-size: 12px;
}

.term-match-title {
    background: #ece9d8;
    border-bottom: 1px solid #b9b6a3;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: bold;
    color: #123fae;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.term-match-team {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    border-bottom: 1px solid #e5e3d8;
    box-sizing: border-box;
    height: 28px;
}
.term-match-team-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.term-match-team b {
    flex-shrink: 0;
    font-size: 13px;
}
.term-match-team:last-child {
    border-bottom: none;
}
.term-match-team.winner {
    background: #316ac5;
    color: #fff;
    font-weight: bold;
}
.term-match-team.tbd {
    color: #888;
    font-style: italic;
}
.term-match-team.bye {
    color: #888;
    font-style: italic;
    font-size: 11px;
}

.term-match-clickable {
    cursor: pointer;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    width: 100%;
    height: 28px;
    text-align: left;
    font-family: inherit;
    color: inherit;
    padding: 6px 10px;
    font-size: 12px;
    box-sizing: border-box;
    border-bottom: 1px solid #e5e3d8;
}
.term-match-clickable:last-child {
    border-bottom: none;
}
.term-match-clickable:hover {
    background: #e4ecfb;
}
.term-match-clickable .term-match-team-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.term-match {
    border: 1px solid #7f9db9;
    background: #fff;
}

/* ---------- Cartes d'équipe ---------- */

.term-team-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.term-team-card {
    border: 1px solid #7f9db9;
    background: #f4f6fb;
    padding: 10px 14px;
    min-width: 180px;
    flex: 1 1 200px;
}
.term-team-card-name {
    font-weight: bold;
    font-size: 13px;
    color: #123fae;
    margin-bottom: 6px;
    border-bottom: 1px solid #d8dce8;
    padding-bottom: 4px;
}
.term-team-card-member {
    font-size: 12px;
    padding: 2px 0;
    color: #333;
}

/* ---------- Réglages organisateur ---------- */

.term-settings-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.term-settings-row form {
    display: flex;
    align-items: center;
    gap: 8px;
}
.term-settings-row .term-input {
    width: 90px;
}

.term-footer-note {
    margin-top: 20px;
    padding: 8px 20px 16px;
    font-size: 11px;
    color: #555;
    text-align: center;
}
.term-footer-note a {
    color: #00f;
}

.term-visitor-counter {
    display: inline-block;
    background: #000;
    color: #33ff66;
    font-family: "Courier New", monospace;
    font-size: 11px;
    padding: 3px 8px;
    border: 1px solid #333;
    letter-spacing: 1px;
}

/* ---------- Écran "INSERT COIN" (page d'accueil) ---------- */

.term-coin-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 999;
    text-align: center;
    padding: 20px;
}
.term-coin-title {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 2px rgba(0,0,0,.6);
    font-family: "Comic Sans MS", cursive;
}
.term-coin-button {
    background: transparent;
    border: none;
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    filter: drop-shadow(0 4px 4px rgba(0,0,0,.5));
    animation: term-coin-spin 2.5s linear infinite;
}
.term-coin-button svg {
    image-rendering: pixelated;
}
@keyframes term-coin-spin {
    0%, 100% { transform: scaleX(1); }
    50% { transform: scaleX(0.15); }
}
.term-coin-button:active {
    transform: translateY(4px) scaleX(1) !important;
    animation: none;
}
.term-coin-hint {
    font-size: 12px;
    color: #ece9d8;
}

/* ---------- Fenêtre agrandie ---------- */

body.term-maximized {
    padding: 0 0 42px;
}
body.term-maximized .term-window {
    max-width: none;
    width: 100%;
    min-height: calc(100vh - 42px);
    margin: 0;
}
body.term-maximized .xp-desktop-icons {
    display: none;
}

/* ---------- Petite messagebox (boutons réduire/fermer) ---------- */

.term-app-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 998;
    padding: 16px;
}
.term-app-box {
    max-width: 320px;
    background: #ece9d8;
    border: 1px solid #0a246a;
    box-shadow: 4px 4px 14px rgba(0,0,0,.6);
    padding: 16px 18px 14px;
    text-align: center;
    font-family: Tahoma, sans-serif;
}
.term-app-box .term-app-title {
    font-weight: bold;
    color: #123fae;
    font-size: 13px;
    margin-bottom: 10px;
}
.term-app-box .term-app-text {
    font-size: 12px;
    color: #000;
    margin-bottom: 14px;
}

/* ---------- Bureau Windows en arrière-plan (barre des tâches + icônes) ---------- */

.xp-desktop-icons {
    position: fixed;
    top: 14px;
    left: 14px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 1;
    pointer-events: none;
}
.xp-desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 72px;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
    font-size: 11px;
    text-align: center;
}
.xp-desktop-icon .xp-icon-glyph {
    display: block;
    line-height: 1;
    margin-bottom: 4px;
}
.xp-icon-svg {
    width: 32px;
    height: 32px;
    filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.5));
}

.xp-taskbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 42px;
    background: linear-gradient(180deg, #2b83e0 0%, #1941c9 45%, #0e2f96 100%);
    border-top: 1px solid #6fa8f0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px;
    z-index: 500;
    font-family: Tahoma, Arial, sans-serif;
}
.xp-start-button {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(180deg, #6fd66f, #2e9e2e 60%, #1e7d1e);
    color: #fff;
    font-weight: bold;
    font-style: italic;
    padding: 7px 16px 7px 10px;
    border-radius: 6px 16px 16px 6px;
    font-size: 13px;
    box-shadow: 0 2px 3px rgba(0,0,0,0.4);
    white-space: nowrap;
}
.xp-taskbar-app {
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.35);
    padding: 5px 12px;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.xp-clock {
    margin-left: auto;
    color: #fff;
    font-size: 12px;
    background: rgba(0,0,0,0.2);
    padding: 6px 12px;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .xp-desktop-icons {
        display: none;
    }
}

/* ---------- Oie (easter egg) ---------- */

.tournois-goose {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 600;
    cursor: pointer;
    filter: drop-shadow(2px 3px 2px rgba(0,0,0,0.4));
}
.tournois-goose svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
    animation: tournois-goose-bob 0.4s ease-in-out infinite;
}
@keyframes tournois-goose-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}
.tournois-goose-leg-a {
    transform-box: fill-box;
    transform-origin: top center;
    animation: tournois-goose-leg-a 0.4s ease-in-out infinite;
}
.tournois-goose-leg-b {
    transform-box: fill-box;
    transform-origin: top center;
    animation: tournois-goose-leg-b 0.4s ease-in-out infinite;
}
@keyframes tournois-goose-leg-a {
    0%, 100% { transform: rotate(-14deg); }
    50% { transform: rotate(14deg); }
}
@keyframes tournois-goose-leg-b {
    0%, 100% { transform: rotate(14deg); }
    50% { transform: rotate(-14deg); }
}
.tournois-goose.tournois-goose-peck svg {
    animation: tournois-goose-peck-anim 0.25s ease;
}
@keyframes tournois-goose-peck-anim {
    50% { transform: scale(1.15, 0.85); }
}

/* ---------- Effets "impact" quand l'oie appuie sur un bouton ---------- */

.tournois-impact {
    position: fixed;
    width: 40px;
    height: 40px;
    pointer-events: none;
    z-index: 700;
    transform: translate(-50%, -50%) scale(0.2);
    opacity: 1;
    animation: tournois-impact-anim 0.4s ease-out forwards;
}
.tournois-impact::before,
.tournois-impact::after {
    content: "";
    position: absolute;
    background: #ffd400;
    top: 50%;
    left: 50%;
}
.tournois-impact::before {
    width: 100%;
    height: 6px;
    transform: translate(-50%, -50%);
}
.tournois-impact::after {
    width: 6px;
    height: 100%;
    transform: translate(-50%, -50%);
}
@keyframes tournois-impact-anim {
    0% { transform: translate(-50%, -50%) scale(0.2) rotate(0deg); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.7) rotate(25deg); opacity: 0; }
}

.tournois-button-flash {
    animation: tournois-button-flash-anim 0.3s ease;
}
@keyframes tournois-button-flash-anim {
    0%, 100% { filter: none; }
    50% { filter: brightness(1.6); }
}

.tournois-shake {
    animation: tournois-shake-anim 0.25s ease;
}
@keyframes tournois-shake-anim {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-5px, 2px); }
    50% { transform: translate(4px, -2px); }
    75% { transform: translate(-3px, 1px); }
}

/* ---------- Responsive : téléphone ---------- */

@media (max-width: 560px) {
    .term-body {
        padding: 10px 6px 40px;
        font-size: 13px;
    }
    .term-content-wrap {
        padding: 14px 12px 18px;
    }
    h1.term-h1 {
        font-size: 17px;
    }
    .term-settings-row {
        flex-direction: column;
        align-items: stretch;
    }
    .term-settings-row form {
        width: 100%;
    }
    .term-button {
        width: 100%;
        text-align: center;
    }
    .term-coin-title {
        font-size: 17px;
    }
    .term-window-buttons button {
        width: 28px;
        height: 26px;
    }
}

/* ---------- Fenêtres "virus" déposées par l'oie (Bloc-notes / photo) ---------- */

.tournois-virus-window {
    position: fixed;
    width: 220px;
    max-width: 80vw;
    background: #fff;
    border: 1px solid #0a246a;
    box-shadow: 3px 3px 10px rgba(0,0,0,.5);
    z-index: 550;
    font-family: Tahoma, Geneva, Verdana, sans-serif;
}
.tournois-virus-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: linear-gradient(180deg, #2657d6 0%, #3d7cf4 8%, #2657d6 40%, #1941c9 60%, #123fae 100%);
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 4px 3px 7px;
}
.tournois-virus-close {
    width: 18px;
    height: 16px;
    background: linear-gradient(180deg,#f0736b,#c21b0e);
    border: 1px solid #7a0000;
    border-radius: 2px;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
}
.tournois-virus-notepad-body {
    padding: 10px;
    font-family: "Courier New", monospace;
    font-size: 12px;
    color: #000;
    min-height: 50px;
    white-space: pre-wrap;
    word-break: break-word;
}
.tournois-virus-photo-body {
    padding: 6px;
    background: #ccc;
}
.tournois-virus-photo-body img {
    width: 100%;
    display: block;
}

.lang-choice-button {
    min-width: 140px;
    padding: 14px 10px !important;
    font-size: 14px;
}

.xp-music-toggle {
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff;
    font-size: 14px;
    padding: 5px 9px;
    cursor: pointer;
    line-height: 1;
}
.xp-music-toggle.playing {
    background: rgba(255,255,255,0.35);
}
