/* Reversi's tea house is scoped to this game; the board remains real controls. */
#fg-stage.tea-game {min-height:calc(100dvh - var(--classroom-play-height,72px));padding:0 12px 24px;color:#4b2113;background:#d59a59 url("../reversi-teahouse/background.d294f97478a5.webp") center / cover no-repeat;}
#fg-stage.tea-game .tea-layout {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2.1fr) minmax(0,1fr);grid-template-areas:'. heading .' 'left board right';align-items:center;gap:0 clamp(10px,1.2vw,20px);width:min(100%,1450px);margin:auto;}
#fg-stage.tea-game .tea-heading {grid-area:heading;justify-self:center;width:min(100%,590px);aspect-ratio:3.65 / 1;display:grid;place-items:center;background:url("../reversi-teahouse/title.aa31e56604c9.webp") center / 100% 100% no-repeat;}
#fg-stage.tea-game .tea-heading h1 {margin:0;font-size:clamp(29px,4.2vw,60px);line-height:1;color:#53210d;font-weight:900;text-align:center;}
#fg-stage.tea-game .tea-board-wrap {grid-area:board;min-width:0;width:min(100%,calc(100dvh - 240px));justify-self:center;}
#fg-stage.tea-game .tea-board-art {position:relative;aspect-ratio:1;background:#693617 url("../reversi-teahouse/board.aeb8eea5fe1f.webp") center / 100% 100% no-repeat;border-radius:3%;}
#fg-stage.tea-game #fg-board {--fg-cell-size:1fr!important;position:absolute;inset:7.5%;width:auto;height:auto;max-width:none;display:grid;grid-auto-rows:minmax(0,1fr);gap:0;padding:0;margin:0;border:0;border-radius:0;background:#176d38;box-shadow:none;overflow:hidden;}
#fg-stage.tea-game.fg-variant-reversi #fg-board .fg-cell {width:100%;height:100%;min-width:0;aspect-ratio:auto;padding:0;border:1px solid #164b24;border-radius:0;background:rgba(28,127,59,.47);box-shadow:none;}
#fg-stage.tea-game.fg-variant-reversi #fg-board .fg-cell.dark {background:rgba(28,127,59,.47);}
#fg-stage.tea-game.fg-variant-reversi #fg-board .fg-cell.hint {box-shadow:none;}
#fg-stage.tea-game #fg-board .fg-cell[data-fg-hint='true']::after {display:none;}
#fg-stage.tea-game #fg-board .fg-cell:hover {transform:none;filter:brightness(1.15);}
#fg-stage.tea-game #fg-board .fg-cell:focus-visible {outline:3px solid #fff19a;outline-offset:-4px;z-index:3;}
#fg-stage.tea-game.fg-variant-reversi #fg-board .fg-disc-wrap {width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:transparent;pointer-events:none;}
#fg-stage.tea-game.fg-variant-reversi #fg-board .fg-disc {width:94%;height:94%;border:0;box-shadow:none;}
#fg-stage.tea-game #fg-board .fg-disc.fg-black {background:url("../reversi-teahouse/black.b4168778fbaf.webp") center / contain no-repeat,radial-gradient(circle at 35% 25%,#888,#171717 50%,#000);}
#fg-stage.tea-game #fg-board .fg-disc.fg-white {background:url("../reversi-teahouse/white.72d85c3fe6f2.webp") center / contain no-repeat,radial-gradient(circle at 35% 25%,#fff,#e3e3e3 70%,#9a9a9a);}
#fg-stage.tea-game #fg-board .tea-placed {animation:tea-place .32s ease-out both;}
#fg-stage.tea-game #fg-board .tea-flipped {animation:tea-flip .38s ease-in-out both;}
@keyframes tea-place {from {transform:scale(.55);opacity:.4;} to {transform:scale(1);opacity:1;}}
@keyframes tea-flip {0% {transform:rotateY(0);} 50% {transform:rotateY(90deg);} 100% {transform:rotateY(0);}}
#fg-stage.tea-game.fg-variant-reversi #fg-board .fg-disc.fg-ghost {width:26%;height:26%;background:#a6f879;border:0;box-shadow:0 0 12px #caff9c;}
#fg-stage.tea-game :is(.tea-left,.tea-right) {min-width:0;align-self:stretch;display:flex;flex-direction:column;align-items:center;}
#fg-stage.tea-game .tea-left {grid-area:left;padding-top:18%;gap:6%;}
#fg-stage.tea-game .tea-right {grid-area:right;justify-content:center;gap:10%;padding-top:26%;}
#fg-stage.tea-game .tea-turn {position:relative;width:100%;aspect-ratio:2 / 1;background:#fff0ca url("../reversi-teahouse/turn.113f08df261c.webp") center / 100% 100% no-repeat;border-radius:22px;font-weight:900;}
#fg-stage.tea-game .tea-turn strong {position:absolute;top:27%;left:0;width:100%;text-align:center;font-size:clamp(13px,1.35vw,22px);line-height:1;}
#fg-stage.tea-game .tea-turn div {position:absolute;left:12%;right:12%;top:52%;height:25%;display:flex;align-items:center;justify-content:center;gap:.25em;font-size:clamp(18px,1.7vw,28px);line-height:1;white-space:nowrap;}
#fg-stage.tea-game .tea-turn-disc,.tea-game .tea-disc {display:inline-block;width:1.6em;aspect-ratio:1;flex:none;border-radius:50%;}
#fg-stage.tea-game .tea-turn-disc {width:1.25em;max-height:100%;}
#fg-stage.tea-game .tea-turn-disc,.tea-game .tea-disc--black {background:#222 url("../reversi-teahouse/black.b4168778fbaf.webp") center / contain no-repeat;}
#fg-stage.tea-game .tea-turn[data-turn='white'] .tea-turn-disc,.tea-game .tea-disc--white {background:#eee url("../reversi-teahouse/white.72d85c3fe6f2.webp") center / contain no-repeat;}
#fg-stage.tea-game .tea-turn[data-turn='none'] .tea-turn-disc {display:none;}
#fg-stage.tea-game .tea-score {width:80%;aspect-ratio:1.22 / 1;display:grid;grid-template-rows:44% 56%;padding:7% 8%;background:#f9e6c3 url("../reversi-teahouse/score.1d6526b40262.webp") center / 100% 100% no-repeat;border-radius:20px;}
#fg-stage.tea-game .tea-score-name {display:flex;justify-content:center;align-items:center;gap:.3em;color:#fff7e9;font-size:clamp(20px,2vw,33px);line-height:1;}
#fg-stage.tea-game .tea-count {display:grid;place-items:center;color:#4c1b0d;font-size:clamp(35px,4.1vw,68px);font-weight:900;line-height:1;}
#fg-stage.tea-game .tea-reset {position:relative;width:100%;min-height:54px;aspect-ratio:3 / 1;display:flex;align-items:center;justify-content:center;gap:.25em;padding:0 12%;border:0;border-radius:999px;background:#9a2418 url("../reversi-teahouse/button.7a11edfd5012.webp") center / 100% 100% no-repeat;color:white;font-size:clamp(18px,1.85vw,29px);font-weight:900;line-height:1;white-space:nowrap;cursor:pointer;text-shadow:0 2px 2px #5e1910;}
#fg-stage.tea-game .tea-reset :is(.tea-reset-icon,.tea-reset-label) {position:relative;top:-5%;}
#fg-stage.tea-game .tea-reset .tea-reset-icon {font-size:1.2em;line-height:1;}
#fg-stage.tea-game .tea-reset .tea-reset-label {line-height:1;}
#fg-stage.tea-game .tea-more {width:100%;margin:0;}
#fg-stage.tea-game .tea-more summary {width:min(100%,150px);min-height:44px;margin:auto;background:#fff5df;color:#582914;}
#fg-stage.tea-game .tea-reset:focus-visible {outline:4px solid #f9e48c;outline-offset:2px;}
#fg-stage.tea-game.tea-art-ready :is(.tea-board-art,.tea-turn,.tea-score,.tea-reset) {background-color:transparent;}
#fg-stage.tea-game :is(#fg-turn-dot-top,#fg-turn-dot-bottom) {display:none;}
html[data-classroom-playing] #fg-stage.tea-game #fg-reset[data-play-native-control] {display:flex!important;}
html[data-classroom-game='reversi'] #classroom-play-toolbar [data-play-action='reset'] {display:none;}
@media(max-width:850px){
 #fg-stage.tea-game {padding:0 6px 18px;}
 #fg-stage.tea-game .tea-layout {grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:'heading heading' 'turn turn' 'board board' 'black white' 'reset more';width:min(100%,620px);gap:4px 8px;}
 #fg-stage.tea-game .tea-heading {width:min(85%,420px);}
 #fg-stage.tea-game .tea-heading h1 {font-size:clamp(28px,7vw,48px);}
 #fg-stage.tea-game :is(.tea-left,.tea-right) {display:contents;}
 #fg-stage.tea-game .tea-turn {grid-area:turn;justify-self:center;width:min(62%,250px);}
 #fg-stage.tea-game .tea-turn strong {font-size:clamp(13px,2.2vw,17px);}
 #fg-stage.tea-game .tea-turn div {font-size:clamp(17px,3vw,21px);}
 #fg-stage.tea-game .tea-board-wrap {grid-area:board;width:min(100%,520px);}
 #fg-stage.tea-game .tea-score {width:min(100%,180px);justify-self:center;aspect-ratio:1.7 / 1;padding:5% 8%;}
 #fg-stage.tea-game .tea-score--black {grid-area:black;}
 #fg-stage.tea-game .tea-score--white {grid-area:white;}
 #fg-stage.tea-game .tea-score-name {font-size:20px;}
 #fg-stage.tea-game .tea-count {font-size:32px;}
 #fg-stage.tea-game .tea-reset {grid-area:reset;min-height:48px;aspect-ratio:3 / 1;font-size:20px;}
 #fg-stage.tea-game .tea-more {grid-area:more;}
}
@media(min-width:600px) and (max-width:850px){
 #fg-stage.tea-game .tea-heading {width:min(75%,340px);}
 #fg-stage.tea-game .tea-turn {width:min(50%,210px);}
 #fg-stage.tea-game .tea-board-wrap {width:min(100%,440px);}
 #fg-stage.tea-game .tea-score {width:min(100%,155px);}
}
@media(max-width:500px){
 #fg-stage.tea-game .tea-heading {width:min(75%,320px);aspect-ratio:4 / 1;}
 #fg-stage.tea-game .tea-turn {width:min(54%,210px);}
}
@media(prefers-reduced-motion:reduce){#fg-stage.tea-game :is(.fg-disc,.fg-board-grid,.fg-cell){animation:none!important;transition:none!important;}}
