/* Bulbitube v3 : surcharges de styles.css (tirage "Qui est ce Pokémon ?", cartes, Pokédex détaillé, sac) */
.stage { grid-template-rows: 150px 720px 1fr auto; }
.bottom { padding: 18px 36px 30px; }

/* Milieu : tirage, roue des méthodes, défilé des cartes */
.middle { position: relative; display: flex; flex-direction: column; min-height: 0; place-items: initial; }
.who { position: relative; flex: 1; min-height: 0; overflow: hidden;
  background: #1b4fa8 repeating-conic-gradient(from 0deg at 32% 55%, #2a6fd6 0deg 9deg, #1b4fa8 9deg 18deg); }
.who-pic { position: absolute; left: 3%; top: 15%; bottom: 3%; width: 56%; background: center / contain no-repeat; image-rendering: pixelated; filter: brightness(0); }
.who.reveal .who-pic { filter: drop-shadow(0 10px 0 rgba(0,0,0,.25)); transition: filter .25s; }
.who.reveal .who-pic { top: 4%; }
.who .q { position: absolute; right: 90px; top: 54%; transform: translateY(-50%); font-family: 'Press Start 2P', monospace; font-size: 210px; color: var(--gold); -webkit-text-stroke: 12px #1b3a8a; paint-order: stroke fill; }
.who.reveal .q, .who.reveal .who-title { display: none; }
.who-title { position: absolute; left: 0; right: 0; top: 26px; text-align: center; font-family: 'Press Start 2P', monospace; font-size: 34px; color: var(--gold); text-shadow: 5px 5px 0 #1b3a8a; }
.who-name { position: absolute; right: 30px; top: 50%; width: 40%; transform: translateY(-80%); text-align: center; font-family: 'Press Start 2P', monospace; font-size: 42px; line-height: 1.3; color: var(--gold); text-shadow: 5px 5px 0 #1b3a8a; opacity: 0; overflow-wrap: anywhere; }
.who-name.long { font-size: 30px; }
.who-sub { position: absolute; right: 30px; top: 50%; width: 40%; transform: translateY(60px); text-align: center; font-size: 26px; font-weight: 800; text-shadow: 3px 3px 0 #1b3a8a; opacity: 0; }
.who.reveal .who-name, .who.reveal .who-sub { opacity: 1; }

.wheel-wrap { position: relative; flex: 1; display: grid; place-items: center; }
#wheel { width: 640px; height: 640px; }
.wheel-pointer { top: calc(50% - 320px - 22px); z-index: 2; }

/* grille de toutes les cartes du Pokémon tiré (défilement vertical) */
.cardstrip { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: max-content; gap: 16px; align-content: start; padding: 18px 24px 24px; background: #0b1014; scrollbar-width: none; }
.cardstrip::-webkit-scrollbar { display: none; }
.cardstrip img[data-file] { width: 100%; border-radius: 12px; cursor: pointer; box-shadow: 0 6px 14px rgba(0,0,0,.6); background: #1b232d; aspect-ratio: 63 / 88; object-fit: cover; }
.cardstrip img.sel, .dex-detail .cards img.sel { outline: 7px solid var(--gold); outline-offset: -2px; }
.cards-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; font-family: 'Press Start 2P', monospace; font-size: 30px; color: var(--gold); text-shadow: 3px 3px 0 #000; }
.cards-head img { width: 96px; height: 96px; image-rendering: pixelated; }
.cards-head small { margin-left: auto; font-size: 18px; color: #aeb8c4; }
.cardstrip .empty { grid-column: 1 / -1; font-family: 'Press Start 2P', monospace; font-size: 20px; color: #8a96a3; padding: 60px 0; text-align: center; }
.card-big { position: absolute; inset: 0; z-index: 20; background: rgba(5,8,12,.9); display: grid; place-items: center; cursor: zoom-out; animation: pop .25s; }
.card-big img { width: 86%; border-radius: 34px; box-shadow: 0 20px 60px #000; }

/* bulle de dialogue du jeu, posée sur l'écran de jeu */
.npc { position: absolute; left: 18px; right: 18px; bottom: 16px; min-height: 190px; background: #f8f8f8; color: #404040; border: 10px solid #6890b8; border-radius: 26px; box-shadow: inset 0 0 0 6px #d8e8f8, 0 6px 0 rgba(0,0,0,.35); padding: 26px 40px; font-family: 'Press Start 2P', monospace; font-size: 31px; line-height: 1.75; text-shadow: 3px 3px 0 #d0d0c8; }
.npc i { position: absolute; right: 30px; bottom: 16px; font-style: normal; color: #e04040; font-size: 26px; animation: blink .7s steps(2) infinite; }
@keyframes blink { 50% { transform: translateY(6px); } }

/* fond animé derrière la roue des méthodes */
.wheel-wrap { overflow: hidden; background: #241a4d; }
.wheel-wrap::before { content: ""; position: absolute; left: 50%; top: 50%; width: 1800px; height: 1800px; margin: -900px; background: repeating-conic-gradient(#3a2a7a 0 15deg, #2a1d5e 15deg 30deg); animation: turn 50s linear infinite; }
.wheel-wrap::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, transparent 38%, rgba(10,6,30,.7) 100%); pointer-events: none; }
@keyframes turn { to { transform: rotate(360deg); } }
#wheel { position: relative; z-index: 1; }

/* Bas */
.method-value { display: flex; align-items: center; gap: 16px; }
.method-value img { width: 64px; height: 64px; }
.pool .mon.locked::after { content: "🔒"; position: absolute; right: -6px; bottom: -8px; font-size: 30px; }
.bag { display: flex; gap: 12px; flex-wrap: wrap; }
.bag .it { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.1); border-radius: 30px; padding: 6px 18px 6px 14px; font-weight: 800; font-size: 24px; }
.gem { width: 52px; height: 52px; image-rendering: pixelated; flex: none; }
.panel .gem { width: 26px; height: 26px; }
.panel a { color: #f5c542; }

/* Pokédex : grandes vignettes, défilement vertical, fiche au clic */
.dex-grid { min-height: 0; overflow-y: auto; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: max-content; gap: 12px; align-content: start; padding: 12px; scrollbar-width: none; }
.dex-grid::-webkit-scrollbar { display: none; }
.dex-cell { display: block; border-radius: 12px; padding: 26px 8px 10px; text-align: center; overflow: visible; min-height: 0; }
.dex-cell img { aspect-ratio: 1; height: auto; opacity: .5; }
.dex-cell span { left: 10px; top: 8px; font-size: 14px; }
.dex-cell .nm { font-weight: 800; font-size: 24px; color: #aeb8c4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dex-cell .zn { font-size: 17px; color: #7d8894; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dex-cell.caught .nm { color: var(--ink); }
.dex-cell.caught .zn { color: #666; }
.dex-cell.here { outline-width: 5px; outline-offset: -5px; }
.dex-detail { position: absolute; inset: 110px 30px 30px; background: var(--paper); color: var(--ink); border: 6px solid var(--ink); border-radius: 16px; padding: 30px; overflow-y: auto; font-size: 28px; line-height: 1.4; }
.dex-detail .hd { display: flex; gap: 24px; align-items: center; }
.dex-detail .hd img { width: 300px; height: 300px; image-rendering: pixelated; flex: none; }
.dex-detail h3 { font-family: 'Press Start 2P', monospace; font-size: 34px; line-height: 1.3; margin: 0 0 14px; }
.dex-detail .ty { color: #555; font-weight: 800; }
.dex-detail .st { display: inline-block; margin-top: 12px; padding: 8px 16px; border-radius: 30px; background: #c9ced6; font-weight: 800; }
.dex-detail .st.ok { background: var(--green); color: #fff; }
.dex-detail dt { font-family: 'Press Start 2P', monospace; font-size: 17px; color: #c8102e; margin-top: 24px; }
.dex-detail dd { margin: 8px 0 0; }
.dex-detail .acts { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.dex-detail button { font: inherit; font-weight: 800; border: 5px solid var(--ink); border-radius: 12px; background: #fff; padding: 12px 20px; cursor: pointer; }
.dex-detail button.go { background: var(--gold); }
.dex-detail .x { position: absolute; right: 18px; top: 14px; border-radius: 50%; width: 64px; height: 64px; padding: 0; }
.dex-detail .cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.dex-detail .cards img { width: 100%; border-radius: 10px; cursor: zoom-in; aspect-ratio: 63 / 88; object-fit: cover; background: #ddd; }

.dex-detail .gem { width: 44px; height: 44px; vertical-align: middle; }
.zone-list img.gem { width: 26px; height: 26px; }

/* carte en grand + fiche */
.card-big { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; }
.card-big img { width: 74%; }
.card-info { width: 84%; background: var(--paper); color: var(--ink); border: 6px solid var(--ink); border-radius: 18px; padding: 18px 26px; font-size: 30px; }
.card-info div { display: flex; justify-content: space-between; gap: 20px; padding: 6px 0; }
.card-info b { font-family: 'Press Start 2P', monospace; font-size: 17px; color: #c8102e; align-self: center; }
.card-info span { font-weight: 800; text-align: right; }

/* "Qui est ce Pokémon ?" : rayons qui tournent, logo, éclair à la révélation */
.who { background: #0e3fa8; }
.who::before { content: ""; position: absolute; left: 32%; top: 55%; width: 2600px; height: 2600px; margin: -1300px;
  background: repeating-conic-gradient(#2f7cf0 0 7.5deg, #0e3fa8 7.5deg 15deg); animation: turn 28s linear infinite; }
.who::after { content: ""; position: absolute; left: 32%; top: 55%; width: 760px; height: 760px; margin: -380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.85) 0, rgba(160,210,255,.45) 38%, transparent 68%); }
.who > * { z-index: 1; }
.who-title { top: 22px; font-size: 40px; color: #ffcb05; -webkit-text-stroke: 9px #1d2c7a; paint-order: stroke fill; text-shadow: 0 7px 0 #0b1650; transform: rotate(-2deg); letter-spacing: 1px; }
.who .q { color: #ffcb05; -webkit-text-stroke: 14px #1d2c7a; text-shadow: 0 10px 0 #0b1650; animation: qq 1.1s ease-in-out infinite alternate; }
@keyframes qq { from { transform: translateY(-50%) rotate(-7deg) scale(.94); } to { transform: translateY(-50%) rotate(7deg) scale(1.06); } }
.who-name { color: #ffcb05; -webkit-text-stroke: 9px #1d2c7a; paint-order: stroke fill; text-shadow: 0 7px 0 #0b1650; }
.who-name small { display: block; font-size: 22px; margin-bottom: 14px; color: #fff; }
.who-sub { text-shadow: 0 3px 0 #0b1650; }
.who.reveal .who-pic { animation: whopop .5s cubic-bezier(.2,.9,.2,1.5); }
@keyframes whopop { from { transform: scale(.7); } to { transform: none; } }
.who.flash::after { animation: whoflash .6s ease-out; }
@keyframes whoflash { 0% { width: 3200px; height: 3200px; margin: -1600px; background: #fff; } 100% { width: 760px; height: 760px; margin: -380px; } }

/* scène de combat et transitions, par-dessus l'écran de jeu */
.fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; image-rendering: pixelated; }
.battle { position: absolute; inset: 0; z-index: 2; overflow: hidden;
  background: linear-gradient(180deg, #d8f0f8 0%, #f8f8e8 30%, #e0f0c0 30.5%, #c8e8a8 100%); }
.battle::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(180deg, rgba(255,255,255,.35) 0 6px, transparent 6px 22px); }
.battle .plat { position: absolute; left: 50%; top: 300px; width: 560px; height: 150px; margin-left: -280px; border-radius: 50%; background: #a8d878; border: 8px solid #88c058; box-shadow: inset 0 -14px 0 #98cc68; }
.battle img { position: absolute; left: 50%; top: 20px; width: 400px; height: 400px; margin-left: -200px; image-rendering: pixelated; }
.battle.in img { animation: monin .7s cubic-bezier(.2,.8,.2,1); }
.battle.in .plat { animation: platin .7s cubic-bezier(.2,.8,.2,1); }
@keyframes monin { from { transform: translateX(-900px); filter: brightness(0); } 70% { filter: brightness(0); } to { transform: none; filter: none; } }
@keyframes platin { from { transform: translateX(-900px); } to { transform: none; } }
.npc { z-index: 4; white-space: pre-line; }

/* fin de chasse : félicitations / zut */
.method-value img { object-fit: contain; image-rendering: pixelated; }
.zone-list img { object-fit: contain; }
.outcome { position: absolute; inset: 0; z-index: 30; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 40px; text-align: center; cursor: pointer; animation: pop .3s; }
.outcome .big { position: relative; font-family: 'Press Start 2P', monospace; font-size: 110px; color: #ffcb05; -webkit-text-stroke: 16px #1d2c7a; paint-order: stroke fill; text-shadow: 0 12px 0 #0b1650; }
.outcome .msg { position: relative; font-family: 'Press Start 2P', monospace; font-size: 34px; line-height: 1.7; color: #fff; text-shadow: 4px 4px 0 #000; padding: 0 50px; }
.outcome .pic { position: relative; height: 620px; display: flex; align-items: center; justify-content: center; gap: 30px; }
.outcome .mon { height: 520px; image-rendering: pixelated; }
.outcome .crd { height: 600px; border-radius: 26px; box-shadow: 0 16px 40px rgba(0,0,0,.6); transform: rotate(-6deg); }
.outcome .ball { position: relative; width: 130px; height: 130px; border-radius: 50%; border: 10px solid #101418; background: linear-gradient(180deg, #e3342f 0 44%, #101418 44% 56%, #fff 56%); }
.outcome.win { background: #1648b8; }
.outcome.win .rays { position: absolute; left: 50%; top: 50%; width: 3600px; height: 3600px; margin: -1800px; background: repeating-conic-gradient(#3b86ff 0 7.5deg, #1648b8 7.5deg 15deg); animation: turn 20s linear infinite; }
.outcome.win .big { animation: winbig .6s cubic-bezier(.2,.9,.2,1.6); }
.outcome.win .mon { animation: hop .5s ease-in-out infinite alternate; }
.outcome.win .ball { animation: click 1s ease-out; box-shadow: 0 0 0 0 #ffcb05; }
.outcome.win i { position: absolute; top: -40px; width: 22px; height: 34px; animation: fall linear forwards; }
@keyframes winbig { from { transform: scale(3); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes hop { from { transform: translateY(0); } to { transform: translateY(-46px); } }
@keyframes click { 0% { transform: scale(1.6) rotate(-30deg); } 40% { transform: scale(1) rotate(10deg); } 60% { box-shadow: 0 0 0 60px rgba(255,203,5,0); transform: none; } 100% { box-shadow: 0 0 0 0 rgba(255,203,5,0); } }
@keyframes fall { to { transform: translateY(2100px) rotate(720deg); } }
.outcome.lose { background: linear-gradient(180deg, #2b3442, #11151c); }
.outcome.lose .big { color: #c9d2de; -webkit-text-stroke-color: #11151c; text-shadow: 0 12px 0 #000; animation: shake .5s ease-in-out 2; }
.outcome.lose .mon { animation: flee 2.6s ease-in forwards; }
.outcome.lose .ball { animation: wobble2 .9s ease-in-out 2; }
@keyframes shake { 25% { transform: translateX(-22px) rotate(-3deg); } 75% { transform: translateX(22px) rotate(3deg); } }
@keyframes flee { 0%, 25% { transform: none; filter: none; opacity: 1; } 40% { transform: translateX(-40px) scaleX(-1); } 100% { transform: translateX(900px) scaleX(-1); filter: grayscale(1); opacity: .2; } }
@keyframes wobble2 { 20% { transform: rotate(-25deg); } 50% { transform: rotate(20deg); } 80% { transform: rotate(-10deg); } }

/* vraie Poké Ball (illustration officielle) dans les animations de fin */
.outcome .ball { width: 190px; height: 190px; border: 0; border-radius: 0; background: url(assets/methods/dw/poke-ball.png) center / contain no-repeat; filter: drop-shadow(0 8px 0 rgba(0,0,0,.35)); }
.outcome.win .ball { box-shadow: none; animation: click2 1s ease-out; }
@keyframes click2 { 0% { transform: scale(1.7) rotate(-30deg); } 40% { transform: scale(1) rotate(10deg); } 60% { transform: scale(1.12); } 100% { transform: none; } }

/* --- écrans Attrapé / Raté v2 : la Ball remue, puis verdict, texte dans la boîte du jeu --- */
.outcome { gap: 34px; background: #10151c; }
.outcome .ball, .outcome > i { display: none; }
.outcome .big { min-height: 130px; }
.outcome .pic { height: 640px; width: 100%; }
.outcome .pball { position: absolute; left: 50%; top: 50%; width: 300px; margin: -150px; filter: drop-shadow(0 14px 0 rgba(0,0,0,.4)); }
.outcome .mon { height: auto; width: 440px; image-rendering: pixelated; }
.outcome .gbox { position: relative; width: 92%; min-height: 200px; background: #f8f8f8; color: #404040; border: 10px solid #6890b8; border-radius: 26px; box-shadow: inset 0 0 0 6px #d8e8f8; padding: 26px 36px; text-align: left; font-family: 'Press Start 2P', monospace; font-size: 32px; line-height: 1.75; text-shadow: 3px 3px 0 #d0d0c8; }
.outcome .cnt { position: relative; min-height: 70px; font-family: 'Press Start 2P', monospace; font-size: 34px; color: #ffcb05; text-shadow: 4px 4px 0 #0b1650; display: flex; align-items: center; gap: 18px; }
.outcome .cnt img { width: 64px; image-rendering: pixelated; animation: hop .4s ease-in-out infinite alternate; }
.outcome.wait .mon, .outcome.wait .crd { display: none; }
.outcome.wait .pball { animation: ballwob 1s ease-in-out infinite; }
@keyframes ballwob { 0%, 55%, 100% { transform: none; } 15% { transform: translateX(-34px) rotate(-28deg); } 35% { transform: translateX(34px) rotate(28deg); } 45% { transform: rotate(-8deg); } }
.outcome.win .pball { width: 130px; margin: 0; left: auto; right: 60px; top: auto; bottom: 10px; animation: click2 .8s ease-out; }
.outcome.win .mon { animation: none; }
.outcome.win .crd { animation: cardin .7s cubic-bezier(.2,.9,.2,1.3); }
@keyframes cardin { from { transform: translateY(700px) rotate(20deg); } to { transform: rotate(-6deg); } }
.outcome.lose .pball { animation: ballopen .5s ease-out forwards; }
@keyframes ballopen { 40% { transform: scale(1.3); filter: brightness(4); } 100% { transform: translateY(240px) scale(.5); opacity: .5; filter: grayscale(1); } }
.outcome.lose .crd { display: none; }
.outcome.lose .mon { animation: flee2 3.2s ease-in forwards; }
@keyframes flee2 { 0% { transform: scale(.2); filter: brightness(4); } 12% { transform: scale(1.1); filter: none; } 35% { transform: none; } 45% { transform: scaleX(-1); } 100% { transform: translateX(950px) scaleX(-1); opacity: .3; } }

/* --- écrans de fin v3 : tout l'écran est occupé --- */
.outcome { justify-content: flex-start; gap: 26px; padding: 40px 44px; }
.outcome .cnt { display: none; }
.outcome .ztag { position: relative; align-self: flex-start; background: var(--paper); color: var(--ink); border: 6px solid var(--ink); border-radius: 14px; box-shadow: 6px 6px 0 rgba(0,0,0,.45); padding: 12px 24px; font-family: 'Press Start 2P', monospace; font-size: 26px; text-align: left; }
.outcome .ztag small { display: block; font-size: 14px; color: #666; margin-bottom: 8px; }
.outcome .big { min-height: 150px; font-size: 120px; margin-top: 10px; }
.outcome .pic { height: 700px; flex: none; }
.outcome .crd { height: 680px; }
.outcome .mon { width: 480px; }
.outcome.wait .pic { margin-top: 180px; }
.outcome.wait .pball { width: 380px; margin: -190px; }
.outcome .gbox { width: 100%; min-height: 190px; flex: none; }
.outcome .extra { position: relative; width: 100%; display: flex; flex-direction: column; gap: 22px; animation: pop .4s; }
.outcome .rows { background: rgba(8,12,20,.72); border: 5px solid rgba(255,255,255,.25); border-radius: 20px; padding: 10px 26px; }
.outcome .rows div { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 12px 0; border-bottom: 3px solid rgba(255,255,255,.12); font-size: 32px; font-weight: 800; text-align: right; }
.outcome .rows div:last-child { border: 0; }
.outcome .rows b { font-family: 'Press Start 2P', monospace; font-size: 20px; color: #ffcb05; text-align: left; flex: none; }
.outcome .rows small { font-size: 24px; color: #b8c4d4; }
.outcome .rows img { height: 60px; vertical-align: middle; image-rendering: pixelated; }
.outcome .zprog { background: rgba(8,12,20,.72); border: 5px solid rgba(255,255,255,.25); border-radius: 20px; padding: 18px 22px; text-align: left; }
.outcome .zprog b { font-family: 'Press Start 2P', monospace; font-size: 20px; color: #ffcb05; }
.outcome .zprog div { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.outcome .zprog img { width: 84px; height: 84px; image-rendering: pixelated; background: rgba(255,255,255,.08); border-radius: 12px; filter: brightness(0); opacity: .6; }
.outcome .zprog img.ok { filter: none; opacity: 1; background: rgba(56,193,114,.3); }
.outcome .dbar { position: relative; height: 64px; border: 6px solid var(--ink); border-radius: 34px; background: rgba(8,12,20,.72); overflow: hidden; }
.outcome .dbar div { height: 100%; background: linear-gradient(90deg, #38c172, #ffcb05); min-width: 2%; }
.outcome .dbar span { position: absolute; inset: 0; display: grid; place-items: center; font-family: 'Press Start 2P', monospace; font-size: 24px; text-shadow: 3px 3px 0 #000; }
.outcome .big { font-size: 96px; white-space: nowrap; }
.outcome.lose .crd { display: block; filter: grayscale(1) brightness(.55); transform: rotate(-6deg); }
.outcome.lose .mon { animation: flee3 3s ease-in-out forwards; }
@keyframes flee3 { 0% { transform: scale(.2); filter: brightness(4); } 12% { transform: scale(1.1); filter: none; } 35% { transform: none; } 45% { transform: scaleX(-1); } 100% { transform: translateX(150px) scaleX(-1) scale(.8); filter: grayscale(1); opacity: .45; } }

/* Johto : l'écran de la DS est en 4:3, la zone de jeu est donc plus haute */
.gen2 .stage { grid-template-rows: 150px 810px 1fr auto; }
