/* r63: title / reborn / character select styles, copied from old.html (r42) */
#ovReborn{--gold:#d9b45a;--gold2:#8a6a2a;font-family:"Kanit","Sarabun","Noto Sans Thai",system-ui,sans-serif;user-select:none;-webkit-user-select:none;touch-action:manipulation}
#ovReborn input{user-select:text;-webkit-user-select:text}
:where(#ovReborn) .btn.ghost{background: #3a3550; color: #eee;}
:where(#ovReborn) .btn:disabled{opacity: .45; cursor: default;}
:where(#ovReborn) .card{background: linear-gradient(#2e2d34, #1a191e); border: 3px solid var(--gold); border-radius: 14px; padding: 18px 22px; max-width: min(92vw, 560px); max-height: 88vh; overflow: auto;}
:where(#ovReborn) .card h3{margin: 0 0 10px; color: #f1cd6b; font-weight: 600;}
:where(#ovReborn) .card .btn{margin-top: 14px; background: linear-gradient(#f3d58a, #b58a35); color: #2a1d05; border: 0; border-radius: 8px; padding: 8px 22px; font: 600 16px 'Kanit', sans-serif; cursor: pointer;}
.rb-off-only{display: none !important;}
body.offline-mode .rb-off-only, body.acct-mode .rb-off-only{display: flex !important;}
body.acct-mode #rbShadow{display: none;}
.rb-hair[aria-label="ทรงผม"]{flex-wrap: nowrap;}
.rb-hair[aria-label="ทรงผม"] > span{min-width: 0; flex: none; margin-right: 4px;}
.rb-hair[aria-label="ทรงผม"] .rb-tf{flex: 1 1 0; min-width: 0; padding: 6px 4px; text-align: center; white-space: nowrap; font-size: clamp(13px, 3.7vw, 16px);}
.rb-signin .rb-social-row{display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 6px 0;}
.rb-signin .rb-social{min-width: 150px; display: flex; flex-direction: column; align-items: center; gap: 2px;}
.rb-signin .rb-social small{display: block; font-size: 11px; opacity: .75; font-weight: 400;}
.rb-signin .rb-social:disabled{opacity: .55;}
.rb-signin .rb-google:not(:disabled){background: #fff; color: #222;}
.rb-signin .rb-line:not(:disabled){background: #06c755; color: #fff;}
.rb-signin .rb-facebook:not(:disabled){background: #1877f2; color: #fff;}
.rb-signin .rb-userpass{margin: 8px auto; max-width: 340px; text-align: left;}
.rb-signin .rb-userpass input{width: 100%; margin: 6px 0;}
.rb-account{margin-top: 8px; display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap;}
.rb-menu{gap: 8px; flex-wrap: wrap; margin: 10px 0 6px;}
#ovReborn{background: radial-gradient(ellipse at 50% 40%, rgba(70,40,120,.92), rgba(8,6,16,.97)); z-index: 25;}
.rbcard{width: min(94vw, 760px); max-width: none; text-align: center; background: linear-gradient(#2a2140, #15111f);}
.rbcard h2{margin: 2px 0 6px; font-size: 32px; color: #ffd75a; text-shadow: 0 0 14px rgba(255,200,80,.6);}
.rbcard h3{margin: 0 0 6px; color: #ffe08a;}
.rb-sub{color: #d8cfe8; margin: 2px 0 10px; font-size: 14px;}
.rb-note{display: block; margin-top: 10px; color: #a99cc0; font-size: 12px;}
.rb-big{font-size: 19px; padding: 12px 26px; margin: 6px;}
.rb-title img{width: min(70vw, 440px);}
.rb-title .btn{display: block; margin: 8px auto; min-width: 240px;}
.rb-slots{display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 8px 0 12px;}
.rb-slot{width: 200px; border: 2px solid #5a4a7a; border-radius: 12px; padding: 8px; background: #1e1830; display: flex; flex-direction: column; align-items: center; gap: 4px;}
.rb-slot.cur{border-color: var(--gold); box-shadow: 0 0 14px rgba(217,180,90,.45);}
.rb-slot img{height: 120px;}
.rb-slot span{font-size: 12px; color: #cbbfdd;}
.rb-slot .btn{width: 100%; padding: 6px;}
.rb-slot .btn.sm{font-size: 12px; padding: 4px;}
.rb-slot.empty{justify-content: center; opacity: .85;}
.rb-plus{font-size: 48px; color: #8a7aa8;}
.rb-intro{text-align: left; position: relative; overflow: hidden; isolation: isolate; min-height: clamp(280px, 65dvh, 470px); display: grid; align-items: end;}
#ovReborn .rbcard[data-mode="intro"]{padding: 0; background: #141322;}
#ovReborn .rbcard[data-mode="film"]{padding: 0; background: #000; width: min(100vw, calc(100dvh * 16 / 9)); max-width: 100vw; max-height: 100dvh; border-radius: 0; border: 0; overflow: hidden;}
.rb-film{position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 100dvh; background: #000;}
.rb-film video{display: block; width: 100%; height: 100%; object-fit: contain; background: #000;}
.rb-film-skip{position: absolute; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); z-index: 2; background: #000a; color: #fff; border: 1px solid #fff6; font-size: 15px; padding: 8px 14px;}
.rb-film-gate{position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; gap: 12px; text-align: center; background: #000b; color: #fff;}
.rb-film-gate[hidden]{display: none;}
.rb-intro-art,.rb-intro-portal{position:absolute; inset:0; z-index:-1;}
.rb-intro-art{background: #171b2b url(../ui/app/bangkok-night.webp) center 46% / cover no-repeat; transition: transform .6s, opacity .55s;}
@media (orientation:portrait){
  .rb-intro-art{ background-size:100% auto; background-position:center top; }
}
[data-beat="impact"] .rb-intro-art{transform: scale(1.14); animation: rb-headlights .55s ease-out both;}
@keyframes rb-headlights{ 25% { filter: brightness(2.8) saturate(.65); } 100% { filter: brightness(.65); } }
.rb-signal{position:absolute; left:12px; top:12px; padding:8px 12px; border-radius:8px; background:#151522ed; color:#ff9b95;}
.rb-signal[hidden]{display:none;}
[data-beat="green"] .rb-signal,[data-beat="crossing"] .rb-signal{color:#9af5bd;}
.rb-crossing{position:absolute; z-index:-1; top:55%; left:15%; width:55%; height:19%; opacity:.45; transform:perspective(120px) rotateX(36deg) rotate(-9deg); background:repeating-linear-gradient(90deg,#efdfc7 0 9%,transparent 9% 17%); pointer-events:none;}
[data-beat="portal"] .rb-crossing,[data-beat="impact"] .rb-crossing{opacity:0;}
[data-beat="crossing"] .rb-intro-art{transform:scale(1.07) translateX(-2%);}
[data-beat="impact"] .rb-intro-art{animation:rb-cross-impact .48s ease-out both;}
@keyframes rb-cross-impact{ 18% { filter:brightness(2); } 100% { filter:brightness(.08); } }
.rb-intro-portal{opacity:0; transition:opacity .6s; background:radial-gradient(ellipse 11% 36% at 65% 42%, #fff4cc 15%, #bfa1ff 32%, #5b3f94 68%, transparent 100%), radial-gradient(ellipse at 65% 43%, #3c3066, #101020 67%);}
[data-beat="portal"] .rb-intro-art{opacity:0;}
[data-beat="portal"] .rb-intro-portal{opacity:1;}
.rb-story{padding: clamp(16px,4vw,34px); background:linear-gradient(0deg,#10101ff7 25%,#10101fb8 72%,transparent);}
.rb-story h3{font-size:clamp(26px,5vw,47px);}
.rb-story p{margin: 5px 0; color:#f3eafa;}
.rb-skip{position:absolute; top:12px; right:12px; background:#131424e8 !important;}
.rb-next{margin:12px 0 0;}
.rb-body{border: 1px solid #71627d; border-radius: 8px; color: #f8eefb; background: #241e34; padding: 6px 14px; font: inherit; min-height: 38px;}
.rb-body.on{color: #1a1324; background: #f0d18c; border-color: #f0d18c;}
@media (prefers-reduced-motion: reduce){
  .rb-intro-art,.rb-intro-portal{ animation:none !important; transition:none; }
}
.rb-name{display: block; margin: 12px 0 2px;}
.rb-name input{font: inherit; font-size: 17px; padding: 6px 10px; border-radius: 8px; border: 2px solid #6a5a8a; background: #0f0c18; color: #fff; width: 200px; margin-left: 8px; user-select: text; -webkit-user-select: text;}
.rb-err{color: #ff8a8a; min-height: 20px; font-size: 13px;}
.rb-test{display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 2px; font-size: 13px; color: #ffd27a;}
.rb-test span{margin-right: 4px;}
.rb-tf{border: 1px solid #8a7a52; background: #2a2418; color: #f3e6c8; border-radius: 6px; padding: 4px 9px; font: inherit;}
.rb-tf.on{background: #c9a24a; color: #20180a; border-color: #f0d080;}
.rb-col{width: 30px; height: 30px; border-radius: 50%; border: 2px solid #5a4e36; padding: 0;}
.rb-col.on{border-color: #ffe08a; box-shadow: 0 0 0 2px #c9a24a;}
.rb-wheel{display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 10px auto; max-width: 560px;}
.rb-wheel div{padding: 8px; border: 2px solid #4a3d66; border-radius: 10px; background: #1a1428; color: #bfb2d6; transition: transform .08s;}
.rb-wheel div.on{background: linear-gradient(#ffe08a, #d9a83a); color: #2a1a00; border-color: #fff3c4; transform: scale(1.05); box-shadow: 0 0 18px rgba(255,210,80,.8); font-weight: 700;}
.rb-result{display: flex; gap: 18px; align-items: center; justify-content: center; text-align: left;}
.rb-result .btn{display: block; margin: 8px 0;}
.rb-art{height: min(52vh, 300px); filter: drop-shadow(0 0 18px rgba(160,90,255,.7)); animation: rbIn .6s forwards;}
.rb-kicker{margin: 0; color: #c9a8ff; letter-spacing: 1px;}
@media (max-height: 520px){
  .rbcard{ padding: 10px 16px; max-height: 94vh; }
  .rbcard h3{ margin: 0 0 2px; }
  .rb-sub{ margin: 0 0 4px; font-size: 13px; }
  .rb-title img{ width: auto; height: 40vh; }
  .rb-title .btn{ margin: 5px auto; }
  .rb-big{ font-size: 17px; padding: 8px 22px; margin: 4px; }
  .rb-body img{ height: 30vh; }
  .rb-name{ margin: 6px 0 0; }
  .rb-slot img{ height: 26vh; }
  .rb-slots{ margin: 4px 0 6px; }
  .rb-wheel{ gap: 4px; margin: 4px auto; }
  .rb-wheel div{ padding: 5px; font-size: 14px; }
  .rb-art{ height: 62vh; }
  .rb-pick, .rb-side{ display: inline-flex; vertical-align: middle; }
  .rb-pick{ gap: 8px; }
  .rb-side{ flex-direction: column; align-items: center; margin-left: 14px; }
  .rb-name{ margin: 0; }
  .rb-name input{ display: block; margin: 4px 0 0; }
}
#ovReborn .rbcard{max-height: 94dvh; overflow: auto; border: 1px solid #665875; border-radius: 18px; background: #15111e; box-shadow: 0 18px 80px #07050dc9;}
.rb-create{display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: clamp(12px, 3vw, 32px); text-align: left;}
.rb-preview{display: grid; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; border: 1px solid #766486; border-radius: 14px; overflow: hidden; background: #171524;}
.rb-model{position: relative; height: clamp(160px, 56dvh, 370px); background: radial-gradient(ellipse at 50% 42%, #52406a, #20192e 69%, #171524 94%);}
.rb-model::before{content: ''; position: absolute; left: 23%; right: 23%; bottom: 6%; height: 15%; border: 1px solid #c0a4ed42; border-radius: 50%; background: radial-gradient(ellipse, #9676c751, #4b3a651a);}
.rb-model canvas, .rb-model img{position: absolute; inset: 0; width: 100%; height: 100%;}
.rb-model canvas{touch-action: none; cursor: grab;}
.rb-model canvas:active{cursor: grabbing;}
.rb-model img{object-fit: contain; padding: 4%; box-sizing: border-box; pointer-events: none;}
.rb-preview-controls{padding: 6px 9px; display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; color: #ded2ef;}
.rb-preview-controls .btn{font-size: 12px; padding: 4px 8px; margin: 0;}
.rb-preview [hidden]{display: none !important;}
.rb-choice, .rb-hair{display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 8px 0;}
.rb-choice span, .rb-hair span{min-width: 72px;}
.rb-hair strong{color: #f6d796;}
.rb-hair small{color: #d0c3df; font-size: 12px;}
.rb-options{margin-top: 8px; color: #d8cae7; font-size: 13px;}
.rb-options summary{cursor: pointer;}
.rb-fields .rb-back{margin: 0 0 4px; padding: 5px 10px; font-size: 13px;}
.rb-fields h3{font-size: clamp(21px, 4vw, 32px);}
.rb-fields input{box-sizing: border-box; width: 100%; background: #211a2c; color: #fff; font: inherit; font-size: 16px; padding: 9px 12px; border-radius: 8px; border: 1px solid #827193; user-select: text;}
.rb-fields .rb-big{width: 100%; margin: 2px 0 8px;}
.rb-result{display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr); gap: clamp(12px, 4vw, 32px);}
.rb-result .rb-art{width: 100%; height: min(65dvh, 350px); object-fit: contain; background: radial-gradient(ellipse, #422b5a, transparent 72%);}
.rb-result h2{font-size: clamp(21px, 4vw, 34px); line-height: 1.25;}
@media (max-width: 560px) and (orientation: portrait){
  .rb-create, .rb-result{ grid-template-columns: minmax(0, 1fr); }
  .rb-model{ height: clamp(190px, 34dvh, 260px); }
}
#ovReborn .rbcard[data-mode="create"]{border-color:#8f74ab; background:linear-gradient(125deg,#18162a,#26192e);}
.rb-create .rb-preview{box-shadow:0 0 24px #ad78e92d; border-color:#a78acb88;}
.rb-create > .rb-preview{align-self:start; position:sticky; top:0;}
.rb-create .rb-model{background:repeating-radial-gradient(ellipse at 50% 70%,transparent 0 27px,#dfb5ff16 28px 29px),radial-gradient(ellipse at 50% 49%,#614986,#20172f 66%);}
.rb-create .rb-fields{background:#151321ae; border:1px solid #795e8d80; border-radius:14px; padding:clamp(10px,2vw,18px);}
.rb-create .rb-choice,.rb-create .rb-hair{padding:8px 0; border-bottom:1px solid #5d4b6c;}
.rb-create .rb-big{position:sticky; bottom:0;}
.rb-load{position:absolute; inset:0; display:grid; place-items:center; color:#f4d998; background:#171426a8;}
.rb-wheel .rb-locked{border-style:dashed; background:#272032; color:#c0afd1;}
.rb-wheel .btn{margin:0; min-height:42px;}
.rb-community{display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:8px;}
.rb-community[hidden]{display:none;}
.rb-community input,.rb-community select{max-width:46vw; font:inherit;}
.rb-community small{flex-basis:100%;}
#ovReborn .rbcard[data-mode="lodge"]{padding:0; width:min(96vw,1050px);}
.guild-lodge{display:grid; grid-template-columns:1fr 1.4fr minmax(150px,1fr); grid-template-rows:auto 1fr; align-items:end; gap:8px; padding:12px; min-height:min(81dvh,550px); color:#fff1d3; background:linear-gradient(0deg,#20140dcf,transparent 60%),url(../ui/app/guild-lodge.webp) center/cover;}
.guild-lodge header{grid-column:1/-1; display:flex; align-items:center; gap:8px; text-shadow:0 2px 6px #000;}
.guild-lodge .rb-preview{grid-column:2; grid-row:2; border:0; background:none;}
.guild-lodge .rb-model{height:min(58dvh,420px); background:none;}
.guild-lodge .rb-model::before{border:2px solid #ffe397; box-shadow:0 0 16px #ffcd67; background:none;}
.guild-lodge .rb-preview-controls{background:#211811d9; border-radius:8px;}
.lodge-roster{grid-column:1; grid-row:2; display:flex; flex-wrap:wrap; justify-content:center; gap:5px;}
.lodge-roster button:not(.btn){display:grid; justify-items:center; color:#fff1d3; border:1px solid #c49a55; border-radius:8px; background:#24170caa; font:inherit; cursor:pointer;}
.lodge-roster img{width:min(11vw,105px); height:min(29dvh,180px); object-fit:contain;}
.guild-lodge aside{padding:12px; background:#201b16ed; border:1px solid #c49a55; border-radius:14px; align-self:center;}
.guild-lodge aside h2{overflow-wrap:anywhere; font-size:clamp(19px,4vw,34px);}
@media (orientation:portrait){
  .guild-lodge{ grid-template-columns:1fr 1.4fr; }
  .guild-lodge aside{ grid-column:1/-1; }
  .guild-lodge .rb-model{ height:min(42dvh,350px); }
  .lodge-roster img{ width:19vw; height:min(18dvh,120px); }
}
.rb-result .rb-source{margin: 5px 0 12px; color: #c8b8dc; font-size: .92rem;}
.rb-source strong{color: #f2d58a;}
@media (orientation: portrait){.rb-film{aspect-ratio: auto; height: 100dvh;}}   /* r92 upright opening scene */
