/* はじめてのポーカー v1.1.0 */
:root { color-scheme: light; --ink: #203d35; --muted: #60736b; --green: #17634f; --green-dark: #114a3c; --paper: #f8f7ef; --line: #e3e7dc; --mint: #eaf2e3; --orange: #ffda85; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif; line-height: 1.7; -webkit-font-smoothing: antialiased; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-underline-offset: 4px; }
:focus-visible { outline: 3px solid #c16a16; outline-offset: 4px; }
p, h1, h2, h3 { margin: 0; }
.page { width: min(1160px, 100%); margin: auto; padding: 0 28px; }
.topbar { min-height: 78px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 650; }
.topbar a { text-decoration: none; color: var(--muted); }
.brand { letter-spacing: .16em; font-size: 13px; }
.brand-dot { color: var(--green); font-size: 10px; margin: 0 5px; }
.hero { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 44px 12px 38px; gap: 24px; }
.eyebrow { font-size: 11px; letter-spacing: .13em; font-weight: 700; color: var(--green); margin-bottom: 9px; }
h1 { font-size: clamp(29px, 4.6vw, 47px); letter-spacing: -.06em; font-weight: 850; line-height: 1.35; }
h1 span { color: var(--green); }
.lead { margin-top: 13px; color: var(--muted); font-size: 16px; }
rt { font-size: 9px; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; font-size: 11px; font-weight: 700; }
.badges span, .badges a { padding: 4px 11px; border: 1px solid #dce4d4; border-radius: 5px; background: #fffdf6; text-decoration: none; }
.badges a { background: var(--mint); border-color: var(--mint); }
.hero-cards { position: relative; flex: 0 0 200px; height: 156px; margin-right: 36px; }
.hero-card { position: absolute; width: 91px; height: 128px; border-radius: 11px; padding: 13px 16px; background: #fff; border: 1px solid var(--line); font-size: 29px; font-weight: 700; line-height: 1.3; box-shadow: 0 6px 12px #2a574710; }
.card-one { top: 9px; left: 21px; transform: rotate(-15deg); }
.card-two { top: 23px; left: 90px; transform: rotate(12deg); color: #c44242; }
.hero-star { position: absolute; color: #db9a37; top: -7px; right: 5px; font-size: 31px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; align-items: start; }
main { min-width: 0; }
.mode-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; border-radius: 12px; background: #e9ece3; padding: 5px; margin-bottom: 17px; }
.mode-picker button { min-height: 46px; padding: 10px 8px; border: none; background: transparent; color: var(--muted); font-size: 14px; font-weight: 750; border-radius: 8px; }
.mode-picker button[aria-selected="true"] { background: #fff; color: var(--green); box-shadow: 0 2px 4px #1b433211; }
.game-panel { padding: 25px; border: 1px solid var(--line); border-radius: 19px; background: #fffef9; box-shadow: 0 5px 20px #2a574705; }
.panel-heading { display: flex; gap: 12px; align-items: center; margin-bottom: 19px; }
.section-number { display: grid; place-items: center; flex: 0 0 37px; height: 37px; border: 1px solid #dce6d5; border-radius: 50%; color: var(--green); font-size: 12px; font-weight: 750; }
.panel-heading h2 { font-size: 19px; letter-spacing: -.02em; }
.panel-heading p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.steps { display: flex; gap: 17px; padding: 0; margin: 0 0 18px; list-style: none; font-size: 11px; font-weight: 650; color: var(--muted); }
.steps span { display: inline-grid; place-items: center; background: var(--mint); color: var(--green); width: 20px; height: 20px; border-radius: 50%; margin-right: 3px; }
.exchange-status { padding: 7px 12px; margin: -2px 0 16px; border-radius: 7px; background: #f5f0de; color: #6b5828; font-size: 11px; font-weight: 700; }
.table, .quiz-table { border-radius: 14px; padding: 23px 22px 17px; background: var(--green); color: white; background-image: radial-gradient(ellipse at 50% 50%, #287c65 0, transparent 72%); }
.hand-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 11px; margin-bottom: 13px; }
.hand-heading h3 { font-size: 13px; font-weight: 700; flex-shrink: 0; }
.hand-heading > span { color: #d2e9dc; text-align: right; }
.cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; width: 100%; max-width: 490px; margin: 0 auto; perspective: 700px; }
.playing-card { display: flex; position: relative; flex-direction: column; align-items: center; justify-content: center; min-width: 0; aspect-ratio: .69; border: 3px solid #fff; border-radius: 9px; background: #fffef9; color: #254037; padding: 7px 3px 5px; box-shadow: 0 3px 0 #0b3b3230; line-height: 1; }
.card-value { font-size: clamp(20px, 3vw, 29px); font-weight: 750; font-family: Georgia, "Times New Roman", serif; }
.card-suit { font-size: clamp(25px, 3.8vw, 37px); margin: 8px 0; font-family: "Segoe UI Symbol", sans-serif; }
.card-corner { position: absolute; top: 5px; left: 5px; font-size: 11px; font-family: Georgia, serif; }
.red { color: #bc383d; }
.card-action { font-size: 10px; color: #617268; border-top: 1px solid #e3e7dc; width: 100%; padding-top: 6px; margin-top: 2px; font-weight: 700; }
button.playing-card { transition: transform .16s, border-color .16s; }
button.playing-card:hover:enabled { transform: translateY(-4px); }
.playing-card.selected { border-color: var(--orange); transform: translateY(-6px); background: #fff5d9; }
.selected .card-action { color: #704a0d; border-top-color: #e5c274; }
.playing-card.matched { border-color: #bae2ad; }
.playing-card.just-exchanged { border-color: var(--orange); box-shadow: 0 0 0 2px #ffda8540, 0 3px 0 #0b3b3230; }
.playing-card.matched.just-exchanged { border-color: #bae2ad; }
.card-new-badge { position: absolute; z-index: 1; top: -12px; left: 50%; transform: translateX(-50%); padding: 4px 6px; border-radius: 5px; background: var(--orange); color: #63440d; font: 700 10px/1 sans-serif; white-space: nowrap; }
.draw-arriving { animation: draw-glow .64s ease-out both; }
.draw-arriving::after { content: '✦'; position: absolute; z-index: 2; top: -19px; right: -8px; font-size: 24px; color: #ffe2a0; pointer-events: none; animation: draw-sparkle .64s ease-out both; }
@keyframes draw-glow { 35% { box-shadow: 0 0 22px 5px #ffe1a1b0; background-color: #fff0bd; } 100% { box-shadow: 0 0 0 2px #ffda8540, 0 3px 0 #0b3b3230; } }
@keyframes draw-sparkle { 0% { transform: translateY(8px) scale(.3); opacity: 0; } 30% { transform: translateY(-5px) scale(1.15); opacity: 1; } 100% { transform: translateY(-22px) scale(.6); opacity: 0; } }
.card-back { color: #d6ece3; border: 3px solid #f5f6e8; background-color: #2c7461; background-image: repeating-linear-gradient(45deg, transparent, transparent 5px, #ffffff0a 5px, #ffffff0a 6px), repeating-linear-gradient(-45deg, transparent, transparent 5px, #ffffff0a 5px, #ffffff0a 6px); }
.back-symbol { display: grid; place-items: center; font-size: 28px; border: 1px solid #ffffff70; border-radius: 50%; width: 44px; height: 44px; }
.table-divider { display: flex; align-items: center; gap: 12px; margin: 19px 0 16px; color: #b5d6c5; font-size: 10px; letter-spacing: .1em; }
.table-divider::before, .table-divider::after { content: ""; height: 1px; flex: 1; background: #ffffff24; }
.table-note { text-align: center; color: #d2e9dc; font-size: 10px; margin-top: 13px; }
.current-hand { margin-top: 18px; padding: 14px 16px; background: var(--mint); border-radius: 10px; }
.hand-label { font-size: 11px; color: var(--muted); margin-right: 9px; }
.current-hand strong { color: var(--green-dark); font-size: 16px; }
.current-hand p { color: #516451; font-size: 12px; margin-top: 4px; }
.hint { margin: 12px 0 17px; border: 1px solid var(--line); border-radius: 9px; padding: 11px 14px; font-size: 12px; }
summary { cursor: pointer; font-weight: 700; }
.hint summary { min-height: 23px; }
.hint p { margin-top: 10px; }
.hint-note { color: var(--muted); font-size: 10px; }
.text-button { background: none; color: var(--green); border: 1px solid #c7d6c3; border-radius: 6px; padding: 9px 12px; font-size: 12px; font-weight: 700; margin-top: 9px; min-height: 40px; }
.primary-button { display: flex; align-items: center; justify-content: center; gap: 20px; width: 100%; min-height: 53px; margin-top: 17px; border: 0; border-radius: 10px; padding: 12px 14px; background: var(--green); color: #fff; font-weight: 750; font-size: 16px; box-shadow: 0 3px 0 #0c3c30; }
.primary-button:hover:enabled { background: var(--green-dark); }
.primary-button:disabled { opacity: .6; }
.secondary-button { display: block; width: 100%; min-height: 47px; padding: 10px 14px; margin-top: 12px; border: 1px solid #c7d6c3; border-radius: 9px; background: #f0f5e9; color: var(--green); font-size: 14px; font-weight: 750; }
.secondary-button:hover:enabled { background: #e1edda; }
.secondary-button:disabled { opacity: .6; }
.under-button { text-align: center; font-size: 10px; margin-top: 14px; color: var(--muted); }
.result-panel { border-radius: 11px; padding: 18px; background: #f6f0d9; border: 1px solid #e7dcb1; margin: 17px 0 0; }
.result-label { font-weight: 750; color: #72612f; font-size: 10px; letter-spacing: .1em; }
.result-panel h3 { font-size: 24px; color: var(--green-dark); margin: 5px 0 10px; }
.result-panel > p:not(.result-label) { font-size: 13px; }
.result-panel .result-note { margin-top: 12px; color: var(--muted); font-size: 11px !important; }
.rules { margin: 19px 0 0; padding: 16px 19px; background: #efeee4; border-radius: 10px; font-size: 12px; }
.rules summary { font-size: 13px; }
.rules ol { padding-left: 20px; }
.rules li { margin: 9px 0; }
.rules > p { color: var(--muted); }
.guide { background: #fffef9; border: 1px solid var(--line); border-radius: 17px; padding: 23px 21px 20px; scroll-margin-top: 18px; }
.guide-heading { padding-bottom: 14px; }
.guide-heading h2 { font-size: 20px; margin: 3px 0; }
.guide-heading > p:last-child { color: var(--muted); font-size: 12px; }
.guide-heading > p:last-child span { margin-left: 8px; }
.role-list { list-style: none; padding: 0; margin: 0; counter-reset: hand; }
.role-list > li { border-top: 1px solid var(--line); padding: 14px 0; position: relative; }
.role-title { display: flex; align-items: baseline; gap: 8px; }
.role-number { color: #889684; font-size: 10px; font-weight: 700; width: 16px; flex-shrink: 0; }
.role-list strong { font-size: 13px; line-height: 1.5; }
.role-list > li:first-child strong { font-size: 12px; color: var(--green); }
.role-list p { color: var(--muted); font-size: 11px; line-height: 1.65; margin: 7px 0 0; }
.role-example { display: flex; gap: 4px; margin-top: 8px; }
.mini-card { display: inline-flex; align-items: center; justify-content: center; gap: 2px; width: 41px; height: 30px; background: #fff; border: 1px solid #dce2d5; border-radius: 4px; font-weight: 700; font-family: Georgia, "Segoe UI Symbol", serif; font-size: 13px; }
.role-list > li.current { background: #edf4e6; box-shadow: 0 0 0 9px #edf4e6; border-top-color: transparent; border-radius: 4px; }
.current .role-number { color: var(--green); }
.number-guide { border-top: 1px solid var(--line); padding-top: 14px; font-size: 11px; }
.number-guide summary { font-size: 12px; }
.number-guide p { margin-top: 9px; color: var(--muted); }
.number-order { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.number-order strong { font-size: 12px; }
.number-order > p { font-size: 13px; margin-top: 5px; }
.number-order .small { font-size: 10px; color: var(--muted); line-height: 1.8; margin-top: 8px; }
.quiz-count { display: inline-block; font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: 5px; background: var(--mint); margin-bottom: 13px; }
.quiz-table { padding-bottom: 25px; }
.quiz-answers { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px; margin-top: 19px; }
.quiz-answers button { min-height: 49px; border: 1px solid #cdd9c8; border-radius: 9px; color: var(--green); background: var(--mint); font-size: 13px; font-weight: 750; }
.quiz-answers button:hover:enabled { background: #dcebd3; }
.quiz-answers button:disabled { opacity: .55; }
.quiz-answers button.correct { opacity: 1; background: var(--green); color: white; border-color: var(--green); }
.quiz-answers button.chosen { box-shadow: 0 0 0 3px #e8bb59; }
.footer { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 34px 4px 30px; margin-top: 27px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.footer > span { font-size: 10px; }
.noscript { margin-top: 18px; background: var(--orange); padding: 15px; border-radius: 9px; }
@media (max-width: 920px) {
  .layout { grid-template-columns: minmax(0, 1fr) 295px; gap: 18px; }
  .game-panel { padding: 19px; }
  .table, .quiz-table { padding: 19px 14px 15px; }
  .cards { gap: 6px; }
  .playing-card { border-width: 2px; }
  .card-value { font-size: 24px; }
  .card-suit { font-size: 30px; margin: 7px 0; }
  .guide { padding: 20px 17px; }
  .steps { gap: 9px; font-size: 10px; }
}
@media (max-width: 760px) {
  .page { padding: 0 18px; max-width: 590px; }
  .topbar { min-height: 59px; }
  .hero { padding: 29px 2px 28px; }
  h1 { font-size: clamp(28px, 6.4vw, 37px); }
  .hero-cards { display: none; }
  .eyebrow { font-size: 10px; }
  .lead { font-size: 14px; margin-top: 9px; }
  .badges { font-size: 10px; margin-top: 15px; gap: 5px; }
  .badges span, .badges a { padding: 4px 8px; }
  .layout { grid-template-columns: 1fr; gap: 24px; }
  .game-panel { padding: 19px 17px; border-radius: 15px; }
  .panel-heading { gap: 9px; }
  .panel-heading h2 { font-size: 17px; }
  .panel-heading p { font-size: 11px; }
  .section-number { flex-basis: 32px; height: 32px; }
  .cards { gap: 7px; }
  .card-value { font-size: clamp(22px, 5.8vw, 29px); }
  .card-suit { font-size: clamp(28px, 7.5vw, 37px); margin: 8px 0; }
  .card-corner { display: none; }
  .guide { padding: 22px; }
  .role-list > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: center; padding: 14px 0; }
  .role-example { margin-top: 0; }
  .role-list strong { font-size: 13px; }
  .role-list > li:nth-child(-n+2) .role-title, .role-list > li:nth-child(-n+2) .role-example { grid-column: 1 / -1; }
  .role-list > li:nth-child(-n+2) .role-example { margin-top: 8px; }
  .mini-card { width: 28px; height: 28px; font-size: 10px; gap: 1px; }
  .role-list p { grid-column: 1 / -1; max-width: 100%; }
  .footer { flex-direction: column; gap: 6px; margin-top: 24px; }
}
@media (max-width: 360px) {
  .page { padding: 0 12px; }
  .game-panel { padding: 16px 12px; }
  .table, .quiz-table { padding: 16px 10px 13px; }
  .cards { gap: 5px; }
  .playing-card { padding: 4px 2px; border-radius: 6px; }
  .card-corner { display: none; }
  .card-value { font-size: 22px; }
  .card-suit { font-size: 27px; margin: 6px 0; }
  .card-action { font-size: 9px; padding-top: 4px; }
  .back-symbol { width: 33px; height: 33px; font-size: 23px; }
  .hand-heading { font-size: 10px; }
  .hand-heading h3 { font-size: 12px; }
  .guide { padding: 20px 17px; }
  .role-list > li { grid-template-columns: 1fr; }
  .role-example { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  button.playing-card { transition: none; }
  .draw-arriving, .draw-arriving::after { animation: none; }
}
