*{box-sizing:border-box}body{margin:0;color:#263332;background:#f4f7f6;font-family:"Yu Gothic",Meiryo,sans-serif;line-height:1.7}.memory-match-page{width:min(1040px,calc(100% - 32px));margin:16px auto 32px}h1{font-size:clamp(24px,4vw,32px);margin:0}h2{font-size:21px;margin:0 0 10px}.series-label{font-size:12px;letter-spacing:.15em;color:#52736c}.breadcrumb{font-size:14px}a{color:#17695a}button,input,select{font:inherit;min-height:44px;border:1px solid #a8bdb3;border-radius:8px;padding:7px 12px;max-width:100%}button{cursor:pointer;background:#17695a;color:#fff;font-weight:700}button:disabled{cursor:default;opacity:.45}button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #e7aa38;outline-offset:2px}[hidden]{display:none!important}.poker-shell{position:relative;height:820px;border:1px solid #d7e4df;border-radius:16px;margin:20px 0;padding:58px 0 0;overflow:hidden;background:#fff}.help-open{position:absolute;left:12px;top:12px;z-index:40}.poker-look-reset{position:absolute;top:12px;left:50%;transform:translateX(-50%);z-index:40;font-size:12px}#game-stage{position:relative;height:100%;isolation:isolate;color:#fff;background:#172c2d;overflow:hidden}.table-view{position:absolute;inset:0}#scene{display:block;width:100%;height:100%}.look-enabled{touch-action:none;cursor:grab}.look-enabled:active{cursor:grabbing}#status{position:absolute;top:8px;left:10px;right:10px;margin:0;padding:5px 10px;background:#102a2de8;border-radius:8px;font-size:13px;line-height:1.4;z-index:10;pointer-events:none}#reconnect{position:absolute;right:12px;top:45px;z-index:35}.menu-panel{position:absolute;top:60px;left:14px;width:340px;max-width:calc(100% - 28px);max-height:calc(100% - 74px);overflow:auto;padding:16px;background:#102a2df2;border:1px solid #64847b;border-radius:12px;z-index:5}.entry-buttons{display:grid;gap:8px}.entry-buttons button{min-height:48px}.controls{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.controls button{flex:1}.menu-panel label{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:12px 0}input{width:160px;min-width:0}select{min-width:110px}summary{cursor:pointer;min-height:44px;padding:8px 0}.room-top{position:absolute;top:48px;left:10px;right:10px;display:flex;align-items:center;gap:10px;font-size:13px}.room-top button{margin-left:auto;font-size:12px;padding:4px 8px}.room-top #room-code{font-size:28px;letter-spacing:.06em}.active-game .room-top #room-code{font-size:13px;letter-spacing:0}#lobby{top:110px}#seats{padding-left:24px}#dealer-panel{position:absolute;left:10px;right:10px;top:110px;text-align:center;text-shadow:0 1px 4px #000}#dealer-total{font-size:25px}.cards{display:flex;justify-content:center;flex-wrap:wrap;gap:5px;margin:8px 0}.card{display:flex;align-items:center;justify-content:center;width:56px;height:76px;background:#fffdf4;border:2px solid #aaa997;border-radius:7px;color:#162d35;font:700 25px Georgia,serif;box-shadow:0 2px 5px #0003}.card.red{color:#b6303e}.card.back{background:#234b68;color:#cfdeea}#hand-panel{position:absolute;left:12px;right:12px;bottom:12px;max-height:59%;overflow:auto;padding:10px;background:#102a2deb;border:1px solid #64847b;border-radius:12px;text-align:center}#turn{color:#ffe49b}#points{font-size:15px;margin:3px 0}#hands{display:flex;justify-content:center;flex-wrap:wrap;gap:8px}.hand{padding:4px 9px;min-width:145px;border:2px solid transparent;border-radius:8px}.hand.active{border-color:#e7aa38}.hand strong{font-size:23px}.hand p{font-size:13px;margin:2px 0}.actions{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;margin:8px 0}.actions button{min-width:85px}.actions button small{display:block;font-size:10px}#action-guide{font-size:12px;line-height:1.5;margin:6px auto;max-width:580px}#other-seats{text-align:left;font-size:12px}#other-content{display:flex;flex-wrap:wrap;gap:8px}#other-content p{margin:3px}#tutorial-panel{position:absolute;z-index:20;top:85px;left:10px;right:10px;padding:8px 12px;background:#fff8dd;color:#29372b;border:2px solid #dfa638;border-radius:10px;font-size:13px}#tutorial-panel p{margin:4px 0}#tutorial-panel .controls{margin:6px 0}#tutorial-panel button{font-size:12px;min-height:38px}.tutorial #dealer-panel{top:250px}.tutorial #hand-panel{max-height:47%}#poker-help{width:min(740px,calc(100% - 24px));max-height:88dvh;border:1px solid #a8bdb3;border-radius:14px;padding:0;color:#263332}#poker-help[open]{display:flex;flex-direction:column}#poker-help::backdrop{background:#071b26b3}#poker-help header{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:12px;background:#edf5f1}#poker-help h2,#poker-help form{margin:0}.help-body{overflow:auto;padding:4px 18px 18px;font-size:14px}.is-game-fullscreen.poker-shell{padding-top:64px;height:100%}.instructions{border-top:1px solid #d3e0e5;padding:12px 0;font-size:14px}.instructions h2{font-size:18px}.instructions h3{font-size:16px;margin:24px 0 10px}.instructions p{max-width:70ch}.howto-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.howto-cards article{background:#fff;border:1px solid #d3e0e5;border-radius:10px;padding:12px}.howto-cards h4{margin:0}.instructions details{background:#eaf5ed;border:1px solid #d0e2d5;border-radius:8px;padding:0 12px;margin:10px 0}.guide-controls{border-collapse:collapse;width:100%}.guide-controls th,.guide-controls td{border:1px solid #d3e0e5;padding:10px;text-align:left}.guide-controls th{width:30%;background:#eaf5ed}@media(max-width:600px){.memory-match-page{width:calc(100% - 20px);margin-top:10px}.poker-shell{height:850px;margin-top:12px}.menu-panel{width:calc(100% - 24px);left:12px;background:#102a2de8}.menu-panel:has([data-screen="character"]:not([hidden])){top:auto;bottom:12px;max-height:48%}.room-top{gap:5px}.room-top #room-code{font-size:24px}#phase{font-size:11px}#dealer-panel{top:100px}#hand-panel{left:6px;right:6px;bottom:6px;max-height:62%;padding:7px}.card{width:48px;height:66px;font-size:23px}.hand{padding:3px;min-width:124px}#hands{gap:3px}.actions{gap:4px}.actions button{font-size:13px;min-width:72px;padding:6px}.tutorial #dealer-panel{top:252px}.tutorial #hand-panel{max-height:44%}#tutorial-panel{font-size:12px;top:85px}.howto-cards{grid-template-columns:1fr}.guide-controls th,.guide-controls td{padding:8px}.guide-controls th{width:36%}}

/* Result text and signs identify the outcome independently of color. */
.result-summary{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:4px 16px;border:2px solid currentColor;border-radius:9px;padding:6px 10px;margin-bottom:5px;background:#f4faf4;line-height:1.35}.result-summary>strong{font-size:clamp(21px,3vw,28px)}.result-summary>span{font-size:clamp(20px,3vw,27px);font-weight:700;white-space:nowrap}.result-win{color:#b1f0c7}.result-lose{color:#ffc4bc}.result-neutral{color:#f2e8bf}.result-summary.result-win{color:#135e32;background:#e5f8eb}.result-summary.result-lose{color:#922c23;background:#fff0ed}.result-summary.result-neutral{color:#50471c;background:#fbf6df}.hand .hand-result{display:block;font-size:17px;line-height:1.4;margin-top:3px}@media(max-width:600px){.result-summary{padding:5px 7px;gap:2px 10px}.result-summary>strong{font-size:21px}.result-summary>span{font-size:21px}.hand .hand-result{font-size:15px}}

.poker-shell{height:860px}#room-code{white-space:nowrap}.active-game .room-top #room-code{font-size:24px}.room-top{flex-wrap:wrap}#play{position:absolute;inset:106px 8px 8px;display:flex;flex-direction:column;justify-content:flex-end;gap:8px;pointer-events:none}#play>section{pointer-events:auto;background:#102a2df0;border:1px solid #64847b;border-radius:10px;padding:9px}#player-list{display:flex;flex-wrap:wrap;gap:5px;margin:0;padding:0;list-style:none}#player-list li{padding:4px 8px;border:1px solid #74948a;border-radius:6px;font-size:13px}#player-list .actor{border:2px solid #ffe49b}#player-list .target{background:#345c68}#target-cards{justify-content:flex-start;flex-wrap:nowrap;overflow-x:auto;padding:6px 3px 12px;min-height:96px}.card{flex:0 0 52px;width:52px;height:74px;padding:0;font-size:23px}.card.back{border-color:#c3d7d9}.card.back:disabled{opacity:1}.card.back:not(:disabled){outline:2px solid #ffda70;outline-offset:1px;cursor:pointer}#own-cards{justify-content:flex-start;gap:4px;max-height:168px;overflow:auto}#own-cards .card{flex-basis:45px;width:45px;height:62px;font-size:19px}#turn{display:block;font-size:19px}#target-title,#own-title{margin:0;font-size:15px}#move{min-height:28px;margin:4px 0;font-size:14px;color:#ffe49b}#discard{font-size:12px;margin:3px 0}#result-summary{padding:7px;background:#fff8dd;color:#28392f;border-radius:8px;font-size:20px;font-weight:700}.tutorial #play{top:260px}#tutorial-panel{top:98px}#tutorial-panel .controls{gap:4px}#tutorial-panel button{padding:5px 8px}#action-guide{font-size:14px}.card-arrive{animation:draw-card .36s ease-out}.pair-move{animation:discard-pair .45s ease-out}@keyframes draw-card{from{transform:translateY(-30px) rotate(-8deg);opacity:.3}to{transform:translateY(0);opacity:1}}@keyframes discard-pair{from{transform:translateY(10px);opacity:.2}to{transform:translateY(0);opacity:1}}@media(max-width:600px){.poker-shell{height:850px}.active-game .room-top #room-code{font-size:21px}#play{left:5px;right:5px;bottom:5px;gap:5px}#play>section{padding:6px}#player-list{gap:3px}#player-list li{font-size:11px;padding:3px 5px}#target-cards{gap:7px}.card{flex-basis:51px;width:51px;height:74px}#own-cards{max-height:145px}.tutorial #play{top:280px}#tutorial-panel{left:5px;right:5px;font-size:12px;padding:7px}#move{font-size:12px}#turn{font-size:17px}}@media(prefers-reduced-motion:reduce){.card-arrive,.pair-move{animation:none}}

#own-cards .card.joker{font:700 12px Georgia,serif;letter-spacing:-.3px}.card.joker{font-size:13px}

@media(max-width:600px){#own-cards{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;max-height:none;justify-content:flex-start;padding-bottom:6px}#player-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px}#player-list li{min-width:0;font-size:10px;line-height:1.4;padding:3px 4px;overflow-wrap:anywhere}#play>section{padding:5px}#target-cards{min-height:90px;margin:4px 0;padding-bottom:6px}#own-title{font-size:13px}#action-guide{font-size:12px;margin:3px 0}}

.is-game-fullscreen .help-open{left:auto;right:12px}

/* Fixed board positions remain the same at all widths. */
#play{justify-content:space-between}#play>section:first-child{margin-top:0}#board{display:grid;gap:3px;margin:8px 0}.board-row{display:grid;grid-template-columns:repeat(13,minmax(0,1fr));gap:3px}.board-card{width:100%;height:37px;min-width:0;border-radius:4px;font-size:16px;box-shadow:none}.board-card.empty{background:#345354;color:#b5c9c6;border:1px solid #77918a;opacity:.65}.board-card.open-end{border:2px dashed #ffe49b;opacity:1}.board-card.seven{border-color:#e0b656}.board-card.isolated{border-style:dotted;background:#e2e5dc}#own-cards .card{min-width:45px;min-height:62px;opacity:1}#own-cards .card.playable{border:3px solid #ffdc70;background:#fff6cf;box-shadow:0 0 0 1px #4b3000;cursor:pointer}#own-cards .card:disabled{cursor:default}#own-cards .card:not(.playable){background:#dce3de;color:#53615e}#own-cards .card.red:not(.playable){color:#975b62}#pass{min-height:44px;font-size:14px}#tutorial-panel button{min-height:44px}.tutorial #play{top:280px}#play>section:last-child{max-height:250px;overflow:auto}#player-list{margin-bottom:5px}.active-game .room-top #room-code{font-size:16px}#move{min-height:0}.tutorial #play>section:last-child{max-height:225px}
@media(max-width:600px){.poker-shell{height:940px}#board{gap:3px;margin:5px 0}.board-row{gap:2px}.board-card{height:30px;font-size:11px;border-width:1px}.board-card.open-end{border-width:1px}#play{top:105px}.tutorial #play{top:310px}#turn{font-size:16px}#play>section:last-child{max-height:205px}.tutorial #play>section:last-child{max-height:205px}#tutorial-panel{top:98px}#tutorial-panel .controls{flex-wrap:wrap}#tutorial-panel button{font-size:11px;padding:5px}#own-cards .card{min-width:45px}#result-summary{font-size:17px}#player-list li{font-size:10px}.board-card.red{color:#bd273d}.board-card.empty.red{color:#e6a2a9}}

/* Common wallet remains outside the game overlay so it can wrap on phones. */
#coin-wallet,#coin-summary{position:relative;z-index:3;max-width:100%;overflow-wrap:anywhere}#coin-summary{margin:.35rem .6rem;padding:.4rem .6rem;background:#17392f;color:#fff;border-radius:.4rem}#coin-wallet:empty{display:none}#coin-stake{max-width:100%}

#play{inset:112px 8px 12px;justify-content:center}#play>section{width:100%;max-width:780px;margin:auto!important;max-height:none!important;overflow:visible!important}#board{display:grid;grid-template-columns:repeat(6,minmax(44px,1fr));gap:8px;margin:14px auto;max-width:620px}.memory-card{width:100%;height:86px;min-width:44px;min-height:44px;padding:2px;font-size:clamp(19px,3vw,29px);border:2px solid #c7d7cd;border-radius:8px;background:#fffdf4;color:#162d35}.memory-card.red{color:#b6303e}.memory-card.back{background:#234b68;color:#fff}.memory-card:disabled{opacity:1}.memory-card.matched{background:#d4e7d3;border-style:dashed}.memory-card:not(:disabled){outline:2px solid #ffda70;outline-offset:1px}.room-top #room-code,.active-game .room-top #room-code{font-size:26px}.tutorial #play{top:290px}#player-list li{overflow-wrap:anywhere} @media(max-width:600px){#board{gap:5px;margin:10px auto}.memory-card{height:63px;font-size:19px}#play{left:5px;right:5px;top:115px}.tutorial #play{top:310px}#play>section{padding:6px}#turn{font-size:17px}.room-top #room-code,.active-game .room-top #room-code{font-size:23px}.poker-shell{height:900px}}

.tutorial #board{grid-template-columns:repeat(4,minmax(44px,1fr));max-width:420px}
