/* ==========================================================================
   Villaggio : page plein ecran pensee pour l'iPad (tactile d'abord).
   - memes codes que le reste du jeu : barre de navigation commune
     (../index/style.css + shared-nav.js), cartes sombres, accents orange ;
   - l'ile flotte sur la mer, dessinee dans le canvas ;
   - aucune barre de defilement de page : la carte gere ses propres gestes ;
   - cibles tactiles >= 48 px, textes lisibles a bout de bras ;
   - marges "safe-area" pour l'encoche et la barre d'accueil iPadOS ;
   - pas de backdrop-filter au-dessus de la carte : sur iPad, le flou serait
     recalcule a chaque image de la mer (et les panneaux sont deja opaques).
   ========================================================================== */

:root {
    --v-bg: #0a0a0a;
    --v-panel: linear-gradient(180deg, rgba(30, 30, 30, 0.92), rgba(18, 18, 18, 0.94));
    --v-panel-solid: #151515;
    --v-glass: rgba(20, 20, 20, 0.78);
    --v-border: rgba(255, 255, 255, 0.09);
    --v-border-strong: rgba(255, 255, 255, 0.16);
    --v-text: #ffffff;
    --v-muted: #a3a3a3;
    --v-primary: linear-gradient(135deg, #f97316, #dc2626);
    --v-orange: #f97316;
    --v-red: #ef4444;
    --v-green: #22c55e;
    --v-gold: #facc15;
    --v-radius: 18px;
    --v-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    --v-safe-top: env(safe-area-inset-top, 0px);
    --v-safe-bottom: env(safe-area-inset-bottom, 0px);
    --v-safe-left: env(safe-area-inset-left, 0px);
    --v-safe-right: env(safe-area-inset-right, 0px);
    --v-sea: #0c4a6e;
    /* Marges laterales du HUD : alignees sur la barre de navigation (conteneur de 1100 px). */
    --v-side: max(calc(var(--v-safe-left) + 2rem), calc((100vw - 1100px) / 2 + 2rem));
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    /* style.css impose sa police a chaque element : ici tout suit celle de la page. */
    font-family: inherit;
}

html,
body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    background: var(--v-bg);
    color: var(--v-text);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Rounded", system-ui, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

button,
a {
    font: inherit;
    color: inherit;
    touch-action: manipulation;
}

.hidden {
    display: none !important;
}

/* --- Application ---------------------------------------------------------- */

.v-app {
    /* Bas de la barre de navigation, mesure en JS (village.render.js) ; valeur de depart approchee. */
    --v-nav-bottom: calc(var(--v-safe-top) + 142px);
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: var(--v-sea);
}

#v-sea,
#v-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

#v-sea {
    pointer-events: none;
}

#v-canvas {
    touch-action: none;
    cursor: grab;
}

#v-canvas.is-dragging {
    cursor: grabbing;
}

/* --- Boutons ------------------------------------------------------------------ */

.v-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 52px;
    padding: 0 1.15rem;
    border-radius: 16px;
    border: 1px solid var(--v-border-strong);
    background: var(--v-panel);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: var(--v-shadow);
    transition: transform 0.12s ease, filter 0.15s ease, opacity 0.15s ease;
}

.v-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.v-btn:disabled,
.v-btn.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.v-btn small {
    font-size: 0.78rem;
    font-weight: 800;
    opacity: 0.9;
}

.v-btn-icon {
    width: 52px;
    padding: 0;
    font-size: 1.35rem;
}

.v-btn-small {
    min-height: 40px;
    padding: 0 0.8rem;
    border-radius: 12px;
    font-size: 0.9rem;
    box-shadow: none;
}

/* Boutons "3D" : degrade + liseret sombre en bas, comme les gros boutons du jeu */
.v-btn-build,
.v-btn-collect,
.v-btn-confirm,
.v-btn-gold,
.v-btn-attack,
.v-btn-army,
.v-btn-visit,
.v-btn-magic {
    border: none;
    border-bottom: 4px solid rgba(0, 0, 0, 0.35);
}

.v-btn-build {
    background: var(--v-primary);
    box-shadow: 0 10px 26px rgba(249, 115, 22, 0.35);
}

.v-btn-attack {
    background: linear-gradient(135deg, #ef4444, #991b1b);
    box-shadow: 0 10px 26px rgba(220, 38, 38, 0.4);
}

.v-btn-army {
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    box-shadow: 0 10px 26px rgba(37, 99, 235, 0.3);
}

.v-btn-visit {
    background: linear-gradient(135deg, #2dd4bf, #0f766e);
    box-shadow: 0 10px 26px rgba(13, 148, 136, 0.3);
}

.v-btn-magic {
    background: linear-gradient(135deg, #a855f7, #7e22ce);
    box-shadow: 0 10px 26px rgba(126, 34, 206, 0.3);
    flex-direction: column;
    gap: 0;
    line-height: 1.1;
}

.v-btn-collect {
    color: #1c1400;
    background: linear-gradient(135deg, #fde047, #eab308);
    box-shadow: 0 12px 30px rgba(234, 179, 8, 0.3);
}

/* Halo qui pulse : on anime l'opacite d'un calque (GPU), pas le box-shadow (repeint a chaque image). */
.v-btn-collect::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 12px 38px rgba(234, 179, 8, 0.6);
    opacity: 0;
    pointer-events: none;
    animation: v-pulse 2.4s ease-in-out infinite;
}

.v-btn-confirm {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 10px 26px rgba(34, 197, 94, 0.3);
}

.v-btn-confirm:disabled {
    filter: grayscale(0.7);
}

.v-btn-gold {
    background: linear-gradient(135deg, #fb923c, #ea580c);
}

.v-btn-cancel {
    border-color: rgba(239, 68, 68, 0.55);
}

.v-btn-danger {
    border-color: rgba(239, 68, 68, 0.6);
    color: #fecaca;
}

.v-btn-danger.is-armed,
.v-btn-end.is-armed {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fff;
    border-color: transparent;
}

.v-btn-big {
    min-height: 64px;
    padding: 0 1.5rem;
    font-size: 1.12rem;
}

.v-btn:active:not(:disabled).v-btn-build,
.v-btn:active:not(:disabled).v-btn-attack,
.v-btn:active:not(:disabled).v-btn-army {
    transform: translateY(2px);
    border-bottom-width: 1px;
}

.v-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 999px;
    background: #fff;
    color: #b91c1c;
    font-size: 0.8rem;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    animation: v-bump 1.6s ease-in-out infinite;
}

@keyframes v-pulse {
    50% { opacity: 1; }
}

/* --- Navigation commune ------------------------------------------------------ */

.v-nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    max-width: 1100px;
    margin: 0 auto;
    padding: calc(var(--v-safe-top) + 1.25rem) calc(var(--v-safe-right) + 2rem) 0 calc(var(--v-safe-left) + 2rem);
    z-index: 42;
    pointer-events: none;
}

.v-nav .navbar {
    margin-bottom: 0;
    pointer-events: auto;
    /* Meme rendu que sur les autres pages (carte claire sur fond #0a0a0a), mais opaque : elle flotte sur la mer. */
    background: linear-gradient(180deg, #181818, #101010);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.v-nav .mobile-menu-btn {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* --- Barre du haut ------------------------------------------------------------ */

.v-top {
    position: absolute;
    top: calc(var(--v-nav-bottom) + 10px);
    left: var(--v-side);
    right: var(--v-side);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    pointer-events: none;
    z-index: 20;
}

.v-top > * {
    pointer-events: auto;
}

.v-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 52px;
    padding: 0.4rem 1rem;
    border-radius: 16px;
    background: var(--v-panel);
    border: 1px solid var(--v-border);
    box-shadow: var(--v-shadow);
    min-width: 0;
}

.v-title strong {
    font-size: 1.08rem;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v-title span {
    font-size: 0.8rem;
    font-weight: 800;
    color: #fdba74;
}

.v-top-spacer {
    flex: 1;
}

.v-pill {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 52px;
    padding: 0 0.9rem;
    border-radius: 16px;
    background: var(--v-panel);
    border: 1px solid var(--v-border);
    box-shadow: var(--v-shadow);
    white-space: nowrap;
}

.v-pill > span {
    font-size: 1.3rem;
    line-height: 1;
}

.v-pill strong {
    font-size: 1.05rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.v-pill small {
    font-size: 0.78rem;
    font-weight: 800;
    color: #86efac;
    font-variant-numeric: tabular-nums;
}

.v-pill-gold strong {
    color: var(--v-gold);
}

.v-pill-gold.is-bump {
    animation: v-bump 0.45s ease;
}

.v-pill-trophy {
    border-color: rgba(250, 204, 21, 0.5);
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.22), rgba(20, 20, 20, 0.9));
}

.v-pill-trophy strong {
    color: #fde68a;
}

.v-pill-shield {
    border-color: rgba(56, 189, 248, 0.55);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(20, 20, 20, 0.9));
}

.v-pill-shield strong {
    color: #bae6fd;
    font-size: 0.95rem;
}

.v-pill-builders.is-full strong {
    color: #fca5a5;
}

@keyframes v-bump {
    0% { transform: scale(1); }
    35% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

/* --- Barre du bas ------------------------------------------------------------- */

.v-bottom {
    position: absolute;
    left: var(--v-side);
    right: var(--v-side);
    bottom: calc(var(--v-safe-bottom) + 14px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.65rem;
    pointer-events: none;
    z-index: 20;
}

.v-bottom > * {
    pointer-events: auto;
}

.v-bottom > .v-btn {
    min-height: 60px;
}

.v-bottom .v-btn-army small {
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.22);
}

.v-bottom .v-btn-army.is-training small::after {
    content: " ⏱";
}

.v-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.18);
    font-size: 0.85rem;
    font-weight: 900;
}

/* --- Barre de selection / placement -------------------------------------------- */

.v-dock {
    position: absolute;
    left: 50%;
    bottom: calc(var(--v-safe-bottom) + 14px);
    transform: translateX(-50%);
    width: min(700px, calc(100% - 28px - var(--v-safe-left) - var(--v-safe-right)));
    padding: 0.9rem;
    border-radius: 22px;
    background: var(--v-panel);
    border: 1px solid var(--v-border-strong);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
    z-index: 25;
    animation: v-rise 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes v-rise {
    from { opacity: 0; transform: translate(-50%, 18px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.v-dock-head {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.v-dock-emoji {
    width: 56px;
    height: 56px;
    flex: none;
    display: grid;
    place-items: center;
    font-size: 2rem;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.22), rgba(220, 38, 38, 0.14));
    border: 1px solid rgba(249, 115, 22, 0.35);
}

.v-dock-titles {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.v-dock-titles strong {
    font-size: 1.12rem;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v-dock-titles span {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--v-muted);
}

.v-dock-status {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #e5e5e5;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.v-dock-status:empty {
    display: none;
}

.v-dim {
    color: var(--v-muted);
    font-weight: 700;
}

.v-dim.is-bad {
    color: #fca5a5;
}

.v-small {
    font-size: 0.84rem;
    line-height: 1.4;
    margin: 0.4rem 0 0.8rem;
}

.v-meter {
    position: relative;
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.v-meter > i,
.v-meter > em {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #fde047, #eab308);
    transition: width 0.4s ease;
}

.v-meter.is-build > i {
    background: linear-gradient(90deg, #fb923c, #f97316);
}

.v-meter.is-full > i {
    background: linear-gradient(90deg, #f87171, #ef4444);
}

.v-meter.is-magic > i {
    background: linear-gradient(90deg, #c084fc, #a855f7);
}

.v-meter.is-gold > i {
    background: linear-gradient(90deg, #fde68a, #f59e0b);
}

.v-meter.is-stack > i {
    background: linear-gradient(90deg, #38bdf8, #2563eb);
}

.v-meter.is-stack > em {
    background: repeating-linear-gradient(45deg, rgba(56, 189, 248, 0.5) 0 6px, rgba(56, 189, 248, 0.25) 6px 12px);
    border-radius: 0;
}

.v-meter.is-stack.is-magic > i {
    background: linear-gradient(90deg, #c084fc, #a855f7);
}

.v-meter.is-stack.is-magic > em {
    background: repeating-linear-gradient(45deg, rgba(192, 132, 252, 0.5) 0 6px, rgba(192, 132, 252, 0.25) 6px 12px);
}

.v-dock-actions {
    margin-top: 0.8rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 0.6rem;
}

.v-dock-actions .v-btn {
    box-shadow: none;
    width: 100%;
    padding: 0 0.8rem;
}

.v-place-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.v-place-info {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.v-place-info strong {
    font-size: 1.05rem;
    font-weight: 900;
}

.v-place-info span {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--v-muted);
}

.v-place-info span.is-bad {
    color: #fca5a5;
}

.v-place-actions {
    display: flex;
    gap: 0.6rem;
}

.v-place-actions .v-btn {
    box-shadow: none;
    min-width: 128px;
}

/* --- Feuilles (panneaux du bas) ------------------------------------------------ */

.v-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
    animation: v-fade 0.2s ease;
}

@keyframes v-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.v-sheet {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: min(800px, 100%);
    /* Jamais sous la barre de navigation : elle reste visible et utilisable. */
    max-height: min(86vh, 780px, calc(100vh - var(--v-nav-bottom) - 12px));
    display: flex;
    flex-direction: column;
    border-radius: 26px 26px 0 0;
    background: #121212;
    border: 1px solid var(--v-border-strong);
    border-bottom: none;
    box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.6);
    transform: translate(-50%, 105%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 41;
    padding-bottom: var(--v-safe-bottom);
}

.v-sheet::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    border-radius: 26px 26px 0 0;
    background: var(--v-primary);
}

@supports (height: 1dvh) {
    .v-sheet {
        max-height: min(86dvh, 780px, calc(100dvh - var(--v-nav-bottom) - 12px));
    }
}

.v-sheet.is-open {
    transform: translate(-50%, 0);
}

.v-sheet-grip {
    width: 46px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    margin: 12px auto 0;
    flex: none;
}

.v-sheet-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem 0.6rem 1.25rem;
    flex: none;
}

.v-sheet-head h2 {
    flex: 1;
    font-size: 1.3rem;
    font-weight: 900;
}

.v-sheet-head .v-btn-icon {
    box-shadow: none;
    min-height: 48px;
    width: 48px;
}

.v-sheet-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0.25rem 1.25rem 1.4rem;
}

/* Onglets */
.v-tabs {
    display: flex;
    gap: 0.45rem;
    margin-bottom: 1rem;
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 0.25rem 0 0.5rem;
    background: #121212;
}

.v-tabs.is-scroll {
    overflow-x: auto;
    scrollbar-width: none;
}

.v-tabs.is-scroll::-webkit-scrollbar {
    display: none;
}

.v-tab {
    flex: 1;
    min-height: 48px;
    padding: 0 0.7rem;
    border-radius: 14px;
    border: 1px solid var(--v-border);
    background: rgba(255, 255, 255, 0.04);
    font-weight: 800;
    font-size: 0.95rem;
    white-space: nowrap;
    cursor: pointer;
}

.v-tabs.is-scroll .v-tab {
    flex: 1 0 auto;
}

.v-tab.is-active {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.3), rgba(220, 38, 38, 0.25));
    border-color: rgba(249, 115, 22, 0.7);
}

/* Boutique */
.v-shop-meta {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--v-muted);
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.v-shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
    gap: 0.75rem;
}

.v-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 1rem 0.75rem 0.85rem;
    border-radius: 18px;
    border: 1px solid var(--v-border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    text-align: center;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.15s ease;
}

.v-card:active {
    transform: scale(0.97);
}

.v-card.is-available {
    border-color: rgba(249, 115, 22, 0.5);
}

.v-card.is-blocked {
    opacity: 0.6;
}

.v-card-emoji {
    font-size: 2.6rem;
    line-height: 1.1;
}

.v-card-name {
    font-size: 1rem;
    font-weight: 900;
}

.v-card-role {
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fdba74;
}

.v-card-stat {
    font-size: 0.82rem;
    font-weight: 800;
    color: #fde68a;
}

.v-card-foot {
    margin-top: 0.3rem;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.2rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 800;
}

.v-cost {
    color: var(--v-gold);
    font-variant-numeric: tabular-nums;
}

.v-cost.is-short {
    color: #f87171;
}

.v-time {
    color: #cbd5e1;
}

.v-card-count {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 0.75rem;
    font-weight: 900;
    color: var(--v-muted);
}

.v-card-lock {
    margin-top: 0.2rem;
    font-size: 0.8rem;
    font-weight: 800;
    color: #fca5a5;
}

.v-empty {
    padding: 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--v-border-strong);
    color: var(--v-muted);
    font-weight: 700;
    font-size: 0.92rem;
    text-align: center;
    margin-bottom: 0.8rem;
}

/* Details / amelioration */
.v-detail-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.v-detail-hero .v-dock-emoji {
    width: 72px;
    height: 72px;
    font-size: 2.6rem;
}

.v-detail-hero p {
    font-size: 0.92rem;
    font-weight: 600;
    color: #d4d4d4;
    line-height: 1.4;
}

.v-detail-hero .v-detail-role {
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fdba74;
    margin-bottom: 0.2rem;
}

.v-rows {
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    border: 1px solid var(--v-border);
    overflow: hidden;
    margin-bottom: 1rem;
}

.v-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.03);
}

.v-row + .v-row {
    border-top: 1px solid var(--v-border);
}

.v-row > span:first-child {
    color: var(--v-muted);
}

.v-row b {
    font-weight: 900;
    text-align: right;
}

.v-up {
    color: #86efac;
}

.v-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.v-list li {
    padding: 0.65rem 0.9rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--v-border);
    font-size: 0.92rem;
    font-weight: 700;
}

.v-section-title {
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--v-muted);
    margin: 0.4rem 0 0.5rem;
}

.v-warning {
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fecaca;
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
}

.v-note {
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.35);
    color: #fed7aa;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.v-sheet-cta {
    width: 100%;
    min-height: 60px;
    font-size: 1.05rem;
    margin-bottom: 0.6rem;
}

.v-cta-row {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 0.6rem;
}

.v-cta-row .v-btn {
    min-height: 58px;
}

/* --- Armee ------------------------------------------------------------------------ */

.v-capacity {
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.3);
    margin-bottom: 0.9rem;
}

.v-capacity-head {
    display: flex;
    justify-content: space-between;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.v-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.9rem;
}

.v-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--v-border);
    font-weight: 900;
}

.v-chip > span {
    font-size: 1.3rem;
}

.v-chip small {
    font-size: 0.72rem;
    color: var(--v-muted);
    margin-left: 0.2rem;
}

.v-queue {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.v-queue-item,
.v-research,
.v-lab-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--v-border);
}

.v-research {
    background: rgba(168, 85, 247, 0.1);
    border-color: rgba(168, 85, 247, 0.4);
    margin-bottom: 0.9rem;
}

.v-queue-emoji {
    font-size: 1.9rem;
    width: 44px;
    text-align: center;
    flex: none;
}

.v-queue-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-weight: 800;
}

.v-queue-info small {
    font-size: 0.78rem;
    color: var(--v-muted);
}

.v-queue-item .v-btn-icon {
    width: 44px;
    min-height: 44px;
    box-shadow: none;
}

.v-troop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 0.65rem;
}

.v-troop {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.1), rgba(255, 255, 255, 0.02));
    overflow: hidden;
}

.v-troop.is-spell {
    border-color: rgba(192, 132, 252, 0.35);
    background: linear-gradient(180deg, rgba(168, 85, 247, 0.1), rgba(255, 255, 255, 0.02));
}

.v-troop.is-spell .v-troop-level,
.v-troop.is-spell .v-troop-role {
    color: #e9d5ff;
}

.v-troop.is-locked {
    border-color: var(--v-border);
    background: rgba(255, 255, 255, 0.03);
    opacity: 0.65;
}

.v-troop-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.85rem 0.6rem 0.7rem;
    border: none;
    background: none;
    text-align: center;
    cursor: pointer;
}

.v-troop-main:disabled {
    cursor: not-allowed;
}

.v-troop-main:active:not(:disabled) {
    transform: scale(0.97);
}

.v-troop-emoji {
    font-size: 2.4rem;
    line-height: 1.1;
}

.v-troop-level {
    position: absolute;
    top: 8px;
    left: 10px;
    font-size: 0.72rem;
    font-weight: 900;
    color: #bae6fd;
}

.v-troop-role {
    font-size: 0.78rem;
    font-weight: 800;
    color: #bae6fd;
}

.v-troop-meta {
    font-size: 0.78rem;
    font-weight: 800;
    color: #d4d4d4;
}

.v-troop-more {
    margin: 0 0.6rem 0.6rem;
    min-height: 40px;
    border-radius: 12px;
    box-shadow: none;
    font-size: 0.9rem;
}

.v-troop-info {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
    cursor: pointer;
    font-size: 0.95rem;
}

/* --- Laboratorio ------------------------------------------------------------------ */

.v-lab-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.v-lab-item.is-locked {
    opacity: 0.6;
}

.v-lab-item .v-queue-info b small {
    color: #d8b4fe;
    font-size: 0.8rem;
}

.v-lab-item .v-dim {
    font-size: 0.84rem;
}

.v-lab-item .v-btn-magic {
    min-height: 52px;
    min-width: 116px;
    box-shadow: none;
    font-size: 0.92rem;
}

.v-lab-lock {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--v-muted);
    text-align: right;
    max-width: 120px;
}

/* --- Aide ------------------------------------------------------------------------ */

.v-help {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-bottom: 1.1rem;
}

.v-help-item {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 0.85rem 0.95rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--v-border);
}

.v-help-item > span {
    font-size: 1.7rem;
    line-height: 1;
    flex: none;
}

.v-help-item strong {
    display: block;
    font-size: 1rem;
    font-weight: 900;
    margin-bottom: 0.15rem;
}

.v-help-item p {
    font-size: 0.9rem;
    font-weight: 600;
    color: #d4d4d4;
    line-height: 1.4;
}

/* --- Guerre : menu ------------------------------------------------------------------ */

.v-league-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(250, 204, 21, 0.55);
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.2), rgba(217, 119, 6, 0.12));
    margin-bottom: 0.9rem;
}

.v-league-emoji {
    font-size: 3rem;
    line-height: 1;
}

.v-league-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.v-league-info b {
    font-size: 1.15rem;
    font-weight: 900;
}

.v-league-info span {
    font-weight: 800;
    color: #fde68a;
}

.v-league-info small {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--v-muted);
}

.v-army-summary {
    padding: 0.85rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(56, 189, 248, 0.3);
    background: rgba(56, 189, 248, 0.07);
    margin-bottom: 0.9rem;
}

.v-army-summary .v-chips {
    margin: 0.6rem 0;
}

.v-army-summary .v-empty {
    margin: 0.6rem 0;
    padding: 0.6rem;
}

.v-army-summary .v-btn {
    width: 100%;
    min-height: 48px;
    box-shadow: none;
}

.v-army-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.3rem;
}

.v-army-line small {
    font-size: 0.8rem;
    font-weight: 700;
    color: #bae6fd;
}

.v-daily {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.v-daily > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.7rem 0.4rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--v-border);
    text-align: center;
}

.v-daily span {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--v-muted);
}

.v-daily b {
    font-size: 1.15rem;
    font-weight: 900;
}

.v-daily small {
    font-size: 0.72rem;
    font-weight: 700;
    color: #fdba74;
}

.v-stars {
    color: #facc15;
    font-size: 1.05rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.v-stars i {
    font-style: normal;
    color: rgba(255, 255, 255, 0.18);
    text-shadow: none;
}

.v-camp-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.v-camp {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 0.9rem;
    border-radius: 16px;
    border: 1px solid rgba(249, 115, 22, 0.35);
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(255, 255, 255, 0.02));
    text-align: left;
    cursor: pointer;
}

.v-camp:active:not(:disabled) {
    transform: scale(0.98);
}

.v-camp:disabled {
    cursor: not-allowed;
}

.v-camp.is-locked {
    opacity: 0.5;
    border-color: var(--v-border);
}

.v-camp-emoji {
    font-size: 2rem;
    width: 44px;
    text-align: center;
    flex: none;
}

.v-camp-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.v-camp-info b {
    font-weight: 900;
}

.v-camp-info small {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--v-muted);
}

.v-log-item {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "main stars"
        "gain actions";
    align-items: center;
    gap: 0.3rem 0.6rem;
    padding: 0.7rem 0.85rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--v-border);
    margin-bottom: 0.45rem;
}

.v-log-main {
    grid-area: main;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.v-log-main b {
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v-log-main small {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--v-muted);
}

.v-log-item .v-stars {
    grid-area: stars;
    justify-self: end;
}

.v-log-gain {
    grid-area: gain;
    font-size: 0.88rem;
    font-weight: 900;
}

.v-log-gain.is-good,
.is-good {
    color: #86efac;
}

.v-log-gain.is-bad,
.is-bad {
    color: #fca5a5;
}

.v-log-actions {
    grid-area: actions;
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
}

.v-rank {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--v-border);
    margin-bottom: 0.4rem;
}

.v-rank.is-me {
    border-color: rgba(249, 115, 22, 0.7);
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(220, 38, 38, 0.12));
}

.v-rank.is-footer {
    position: sticky;
    bottom: 0;
    margin-top: 0.6rem;
    box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.5);
}

.v-rank-pos {
    width: 40px;
    text-align: center;
    font-weight: 900;
    font-size: 1.05rem;
    flex: none;
}

.v-rank-name {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    font-weight: 900;
}

.v-rank-name small {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--v-muted);
}

.v-rank b {
    font-weight: 900;
    color: #fde68a;
}

.v-defense-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.45rem;
    margin-bottom: 0.9rem;
}

.v-defense-summary > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.7rem 0.3rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--v-border);
}

.v-defense-summary b {
    font-size: 1.1rem;
    font-weight: 900;
}

.v-defense-summary small {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--v-muted);
}

/* --- Guerre : resultat ---------------------------------------------------------------- */

.v-result {
    text-align: center;
    padding: 0.4rem 0 1rem;
}

.v-result-stars {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    font-size: 4rem;
    line-height: 1;
}

.v-result-stars span {
    color: rgba(255, 255, 255, 0.14);
    transform: scale(0.9);
}

.v-result-stars span.is-on {
    color: #facc15;
    text-shadow: 0 0 24px rgba(250, 204, 21, 0.6), 0 3px 0 #b45309;
    animation: v-star-pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.4) both;
}

.v-result-stars span:nth-child(2) {
    font-size: 1.2em;
    margin-top: -0.25em;
}

@keyframes v-star-pop {
    from { transform: scale(0.2) rotate(-30deg); opacity: 0; }
    to { transform: scale(1) rotate(0); opacity: 1; }
}

.v-result-opponent {
    margin-top: 0.6rem;
    font-weight: 800;
    color: var(--v-muted);
}

.v-reward {
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    border: 1px solid rgba(250, 204, 21, 0.55);
    background: linear-gradient(135deg, rgba(66, 50, 6, 0.9), rgba(24, 20, 10, 0.9));
    font-weight: 800;
    margin-bottom: 0.7rem;
}

/* --- Guerre : bataille en direct ----------------------------------------------------- */

.v-battle {
    position: absolute;
    inset: 0;
    z-index: 22;
    pointer-events: none;
}

.v-battle > * {
    pointer-events: none;
}

.v-bt-top {
    position: absolute;
    top: calc(var(--v-nav-bottom) + 10px);
    left: var(--v-side);
    right: var(--v-side);
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.v-bt-panel {
    padding: 0.65rem 0.9rem;
    border-radius: 18px;
    background: var(--v-panel);
    border: 1px solid var(--v-border-strong);
    box-shadow: var(--v-shadow);
}

.v-bt-info {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    max-width: min(48vw, 360px);
}

.v-bt-info strong {
    font-size: 1.08rem;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v-bt-info span {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--v-muted);
}

.v-bt-info .v-bt-stakes {
    color: #fde68a;
}

.v-bt-info .v-bt-loot {
    color: #fde047;
    font-size: 0.95rem;
}

.v-bt-info span:empty {
    display: none;
}

.v-bt-score {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    gap: 0.2rem 0.8rem;
    text-align: right;
}

.v-bt-timer {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 0.5rem;
}

.v-bt-timer small {
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fdba74;
}

.v-bt-timer strong {
    font-size: 1.5rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.v-bt-stars {
    font-size: 1.6rem;
    line-height: 1;
    letter-spacing: 0.04em;
}

.v-bt-stars span {
    color: rgba(255, 255, 255, 0.2);
}

.v-bt-stars span.is-on {
    color: #facc15;
    text-shadow: 0 0 12px rgba(250, 204, 21, 0.6);
    animation: v-star-pop 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.4) both;
}

.v-bt-pct {
    font-size: 1.35rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.v-bt-looted {
    grid-column: 1 / -1;
    font-size: 0.95rem;
    font-weight: 900;
    color: #fde047;
}

.v-bt-hint {
    position: absolute;
    left: 50%;
    bottom: calc(var(--v-safe-bottom) + 150px);
    transform: translateX(-50%);
    width: min(520px, calc(100% - 32px));
    padding: 0.7rem 1rem;
    border-radius: 16px;
    background: rgba(10, 10, 10, 0.72);
    border: 1px solid var(--v-border-strong);
    font-size: 0.92rem;
    font-weight: 800;
    text-align: center;
    line-height: 1.35;
    animation: v-fade 0.4s ease;
}

.v-bt-bottom {
    position: absolute;
    left: var(--v-side);
    right: var(--v-side);
    bottom: calc(var(--v-safe-bottom) + 12px);
    display: flex;
    align-items: flex-end;
    gap: 0.6rem;
}

.v-bt-troops {
    flex: 1;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem;
    border-radius: 20px;
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid var(--v-border);
    scrollbar-width: none;
    pointer-events: auto !important;
}

.v-bt-troops:empty {
    visibility: hidden;
}

.v-bt-troops::-webkit-scrollbar {
    display: none;
}

.v-bt-troop {
    position: relative;
    flex: none;
    width: 72px;
    min-height: 84px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.05rem;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.22), rgba(37, 99, 235, 0.18));
    cursor: pointer;
    transition: transform 0.12s ease;
}

.v-bt-troop.is-selected {
    border-color: #facc15;
    background: linear-gradient(180deg, rgba(250, 204, 21, 0.35), rgba(249, 115, 22, 0.28));
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(250, 204, 21, 0.3);
}

.v-bt-troop.is-spell:not(.is-selected) {
    background: linear-gradient(180deg, rgba(192, 132, 252, 0.24), rgba(124, 58, 237, 0.2));
}

.v-bt-troop.is-spell small {
    color: #e9d5ff;
}

.v-bt-troop.is-empty {
    opacity: 0.35;
    filter: grayscale(1);
}

.v-bt-troop:disabled {
    cursor: default;
}

.v-bt-troop-emoji {
    font-size: 2rem;
    line-height: 1.1;
}

.v-bt-troop b {
    font-size: 0.95rem;
    font-weight: 900;
}

.v-bt-troop small {
    font-size: 0.66rem;
    font-weight: 800;
    color: #bae6fd;
}

.v-bt-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.v-bt-actions .v-btn {
    pointer-events: auto;
    min-width: 128px;
}

.v-bt-actions .v-btn-gold {
    flex-direction: column;
    gap: 0;
    line-height: 1.15;
}

.v-battle[data-kind="replay"] .v-bt-troops {
    pointer-events: none !important;
}

.v-battle.is-over .v-bt-troops {
    opacity: 0.5;
}

/* --- Visites ----------------------------------------------------------------------- */

/* Champ de recherche : 16 px minimum, sinon Safari zoome toute la page au toucher. */
.v-search {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 0.7rem;
    padding: 0 0.9rem;
    min-height: 52px;
    border-radius: 16px;
    background: #1c1c1c;
    border: 1px solid var(--v-border-strong);
}

.v-search:focus-within {
    border-color: var(--v-orange);
}

.v-search input {
    flex: 1;
    min-width: 0;
    height: 50px;
    border: none;
    outline: none;
    background: transparent;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    -webkit-user-select: text;
    user-select: text;
    -webkit-appearance: none;
    appearance: none;
}

.v-search input::placeholder {
    color: var(--v-muted);
}

.v-player {
    width: 100%;
    text-align: left;
    color: inherit;
    cursor: pointer;
    min-height: 58px;
    transition: transform 0.12s ease, border-color 0.15s ease;
}

.v-player:active {
    transform: scale(0.98);
    border-color: rgba(45, 212, 191, 0.7);
}

.v-player.is-off {
    opacity: 0.55;
    cursor: default;
}

.v-player-go {
    flex: none;
    font-size: 0.85rem;
    font-weight: 900;
    color: #5eead4;
}

.v-visit {
    position: absolute;
    inset: 0;
    z-index: 22;
    pointer-events: none;
}

.v-vs-top {
    position: absolute;
    top: calc(var(--v-nav-bottom) + 10px);
    left: var(--v-side);
    right: var(--v-side);
    display: flex;
}

.v-vs-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    max-width: min(80vw, 480px);
}

.v-vs-info strong {
    font-size: 1.1rem;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v-vs-info span {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--v-muted);
}

.v-vs-bottom {
    position: absolute;
    left: var(--v-side);
    right: var(--v-side);
    bottom: calc(var(--v-safe-bottom) + 14px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.65rem;
}

.v-vs-bottom .v-btn {
    min-height: 60px;
    pointer-events: auto;
}

/* --- Notifications ------------------------------------------------------------ */

.v-toasts {
    position: absolute;
    top: calc(var(--v-nav-bottom) + 76px);
    left: 50%;
    transform: translateX(-50%);
    width: min(520px, calc(100% - 24px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 60;
    pointer-events: none;
}

.v-toast {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    max-width: 100%;
    padding: 0.75rem 1.05rem;
    border-radius: 16px;
    background: rgba(18, 18, 18, 0.95);
    border: 1px solid var(--v-border-strong);
    box-shadow: var(--v-shadow);
    font-size: 0.95rem;
    font-weight: 800;
    pointer-events: auto;
    animation: v-toast-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.v-toast.is-error {
    border-color: rgba(239, 68, 68, 0.6);
}

.v-toast.is-success {
    border-color: rgba(34, 197, 94, 0.55);
}

.v-toast.is-reward {
    border-color: rgba(250, 204, 21, 0.65);
    background: linear-gradient(135deg, rgba(66, 50, 6, 0.95), rgba(24, 20, 10, 0.95));
}

.v-toast a,
.v-toast button {
    flex: none;
    padding: 0.4rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 900;
    cursor: pointer;
}

.v-toast.is-leaving {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

@keyframes v-toast-in {
    from { opacity: 0; transform: translateY(-10px) scale(0.97); }
    to { opacity: 1; transform: none; }
}

/* --- Chargement : logo PlayWeb anime (repris de assets/playweb-logo-animation.html) --- */

.v-loading,
.v-error {
    position: absolute;
    inset: 0;
    z-index: 80;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background: #12161a;
}

.v-loading {
    gap: clamp(4px, 1.5vmin, 14px);
    transition: opacity 0.35s ease;
}

.v-loading.is-done {
    opacity: 0;
    pointer-events: none;
}

/* Deux nappes de lumiere : degrades radiaux plutot que filter: blur(), bien moins lourds sur iPad. */
.v-loading-bg i {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    will-change: transform;
}

.v-loading-bg i:first-child {
    width: 60vmax;
    height: 60vmax;
    top: -30vmax;
    right: -10vmax;
    background: radial-gradient(closest-side, #154a8a 30%, rgba(21, 74, 138, 0));
    animation: v-logo-glow 1.2s 0.1s forwards, v-logo-drift-a 14s ease-in-out infinite alternate;
}

.v-loading-bg i:last-child {
    width: 55vmax;
    height: 55vmax;
    bottom: -32vmax;
    right: -14vmax;
    background: radial-gradient(closest-side, #d9531c 30%, rgba(217, 83, 28, 0));
    animation: v-logo-glow 1.2s 0.3s forwards, v-logo-drift-b 12s ease-in-out infinite alternate;
}

.v-logo {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(4px, 1.5vmin, 14px);
}

.v-logo-float {
    animation: v-logo-float 5s ease-in-out 1.8s infinite alternate;
}

.v-logo-mark {
    display: block;
    width: min(46vmin, 360px);
    height: auto;
    overflow: visible;
    filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.35));
}

/* Le contour se dessine, puis le triangle se remplit et la manette se decoupe dedans. */
.v-logo-outline {
    fill: none;
    stroke: #fff;
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: v-logo-draw 0.6s cubic-bezier(0.6, 0.05, 0.2, 1) 0.05s forwards, v-logo-out 0.3s 0.7s forwards;
}

.v-logo-tri {
    fill: #fff;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    animation: v-logo-pop 0.55s cubic-bezier(0.2, 1.2, 0.3, 1) 0.45s forwards;
}

.v-logo-pad,
.v-logo-dpad,
.v-logo-dot {
    transform: scale(0);
    transform-box: fill-box;
    transform-origin: center;
}

.v-logo-pad {
    animation: v-logo-grow 0.45s cubic-bezier(0.2, 1.5, 0.35, 1) 0.75s forwards;
}

.v-logo-dpad {
    animation: v-logo-grow 0.35s cubic-bezier(0.2, 1.6, 0.35, 1) 0.95s forwards;
}

.v-logo-dot {
    animation: v-logo-grow 0.3s cubic-bezier(0.2, 1.8, 0.35, 1) 1s forwards;
}

.v-logo-dot:nth-of-type(2) { animation-delay: 1.04s; }
.v-logo-dot:nth-of-type(3) { animation-delay: 1.08s; }
.v-logo-dot:nth-of-type(4) { animation-delay: 1.12s; }

/* Le mot : chaque lettre monte depuis un masque, puis un reflet le balaie une fois. */
.v-logo-word {
    position: relative;
    display: flex;
    font-family: "Fredoka", ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif;
    font-size: min(15vmin, 120px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.01em;
    color: #fff;
}

.v-logo-word span {
    display: inline-block;
    overflow: hidden;
    padding: 0.08em 0.02em 0.32em;
    margin-bottom: -0.26em;
}

.v-logo-word i {
    display: inline-block;
    font-style: normal;
    transform: translateY(130%) rotate(6deg);
    animation: v-logo-rise 0.5s cubic-bezier(0.2, 0.9, 0.25, 1.15) forwards;
    animation-delay: calc(1s + var(--n) * 0.04s);
}

.v-logo-word::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.75) 50%, transparent 60%);
    background-size: 250% 100%;
    background-position: 130% 0;
    mix-blend-mode: overlay;
    pointer-events: none;
    animation: v-logo-shine 0.8s ease-in-out 1.6s 1 both;
}

@keyframes v-logo-glow { to { opacity: 0.85; } }
@keyframes v-logo-drift-a { to { transform: translate(-8vmax, 10vmax) scale(1.15); } }
@keyframes v-logo-drift-b { to { transform: translate(-14vmax, -8vmax) scale(1.2); } }
@keyframes v-logo-float { to { transform: translateY(-8px); } }
@keyframes v-logo-draw { to { stroke-dashoffset: 0; } }
@keyframes v-logo-out { to { opacity: 0; } }
@keyframes v-logo-pop { from { opacity: 0; transform: scale(0.6) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes v-logo-grow { to { transform: scale(1); } }
@keyframes v-logo-rise { to { transform: none; } }
@keyframes v-logo-shine { to { background-position: -40% 0; } }

/* N'apparait que si le chargement traine, une fois le logo pose. */
.v-loading p {
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: calc(var(--v-safe-bottom) + 2.2rem);
    font-size: 0.95rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.62);
    opacity: 0;
    animation: v-fade 0.4s ease 1.9s forwards;
}

.v-spinner {
    display: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.28);
    border-top-color: #fff;
    animation: v-spin 0.8s linear infinite;
}

@keyframes v-spin {
    to { transform: rotate(360deg); }
}

/* En superposition (lancement d'une bataille) : voile + roue, sans le logo. */
.v-loading.is-overlay {
    gap: 1.1rem;
    background: rgba(10, 10, 10, 0.62);
}

.v-loading.is-overlay .v-loading-bg,
.v-loading.is-overlay .v-logo {
    display: none;
}

.v-loading.is-overlay .v-spinner {
    display: block;
}

.v-loading.is-overlay p {
    position: static;
    max-width: 420px;
    font-size: 1.05rem;
    font-weight: 900;
    color: #fff;
    opacity: 1;
    animation: none;
}

/* --- Erreur de chargement ---------------------------------------------------------- */

.v-error {
    gap: 1.1rem;
    padding: 1.5rem;
    background:
        radial-gradient(circle at 85% 0%, rgba(21, 74, 138, 0.7), transparent 55%),
        radial-gradient(circle at 85% 100%, rgba(217, 83, 28, 0.55), transparent 50%),
        #12161a;
}

.v-error-logo {
    width: min(280px, 64vw);
    height: auto;
}

.v-error p {
    max-width: 420px;
    font-size: 1.05rem;
    font-weight: 900;
    color: #fff;
}

.v-error-actions {
    display: flex;
    gap: 0.75rem;
}

/* --- Petits ecrans / portrait ------------------------------------------------------ */

@media (max-width: 900px) {
    .v-app {
        --v-nav-bottom: calc(var(--v-safe-top) + 122px);
    }

    /* Comme .container de style.css sous 900 px */
    :root {
        --v-side: calc(var(--v-safe-left) + 1rem);
    }

    .v-nav {
        padding: calc(var(--v-safe-top) + 1rem) calc(var(--v-safe-right) + 1rem) 0 calc(var(--v-safe-left) + 1rem);
    }
}

@media (max-width: 820px) {
    .v-bottom .v-label {
        display: none;
    }

    .v-bottom > .v-btn {
        padding: 0 1rem;
    }
}

@media (max-width: 640px) {
    .v-title span,
    .v-pill small,
    .v-pill-builders {
        display: none;
    }

    .v-btn-collect .v-collect-label {
        display: none;
    }

    .v-shop-grid {
        grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    }

    .v-daily,
    .v-defense-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .v-bt-troop {
        width: 62px;
        min-height: 76px;
    }

    .v-bt-actions .v-btn {
        min-width: 104px;
        padding: 0 0.7rem;
    }
}

@media (max-width: 440px) {
    .v-title {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .v-btn-collect::after,
    .v-badge,
    .v-spinner {
        animation: none;
    }

    .v-loading *,
    .v-loading *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
    }

    .v-sheet,
    .v-dock {
        transition: none;
        animation: none;
    }
}
