@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@500;700;800&family=Noto+Sans+JP:wght@500;700;900&display=swap');

:root {
  --ink: #17372d;
  --deep: #0d2e24;
  --green: #287b50;
  --lime: #b9db57;
  --cream: #f7f2df;
  --orange: #ee7246;
  --gold: #f4c84d;
  --cell-h: 120px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 12%, rgba(255,255,255,.8) 0 2px, transparent 3px),
    radial-gradient(circle at 80% 28%, rgba(255,255,255,.65) 0 1px, transparent 2px),
    linear-gradient(135deg, #e4ead0, #d1dcc2);
  background-size: 90px 90px, 70px 70px, auto;
  font-family: "DM Sans", "Noto Sans JP", sans-serif;
  min-height: 100vh;
  padding: 32px 18px 45px;
}
html { scroll-behavior: smooth; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .14;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.4'/%3E%3C/svg%3E");
}

button { font: inherit; }
.game-shell { width: min(960px, 100%); margin: auto; position: relative; }

.brand { display: flex; align-items: center; gap: 16px; margin: 0 20px 18px; }
.brand-mark { width: 64px; height: 64px; border: 3px solid var(--ink); border-radius: 50%; display: grid; place-items: center; }
.brand-mark span {
  width: 40px; height: 40px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #8ec95c 0 9%, #3e9159 30%, #1c5f43 70%);
  box-shadow: inset -4px -5px 0 rgba(0,0,0,.1);
}
.brand h1 { margin: -3px 0 0; line-height: 1; font: 900 40px "Noto Sans JP", sans-serif; letter-spacing: -.08em; color: var(--green); }
.brand h1 span { font: 800 21px "DM Sans"; letter-spacing: .06em; margin-left: 10px; color: var(--deep); }
.eyebrow, .section-label { margin: 0 0 5px; font-size: 10px; font-weight: 800; letter-spacing: .22em; color: #5e7b68; }
.sound-button {
  margin-left: auto; width: 44px; height: 44px; border: 2px solid var(--ink); border-radius: 50%;
  background: transparent; color: var(--ink); font-size: 19px; font-weight: 900; cursor: pointer;
}
.sound-button.muted { opacity: .45; text-decoration: line-through; }

.machine {
  background: var(--deep);
  border: 4px solid var(--ink);
  border-radius: 30px 30px 20px 20px;
  padding: 18px;
  box-shadow: 0 16px 0 #8da183, 0 22px 35px rgba(20,50,35,.24);
}
.machine-top { display: grid; grid-template-columns: 1fr 2.2fr 1fr; gap: 10px; margin-bottom: 14px; }
.machine-top > div { min-height: 72px; padding: 10px 14px; background: #163d30; border: 1px solid #396052; border-radius: 10px; color: #e9f2d6; }
.machine-top span { display: block; color: #8bb39e; font-size: 9px; letter-spacing: .16em; font-weight: 800; }
.machine-top strong { color: var(--lime); font-size: 29px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.machine-top small { color: #8bb39e; font-size: 11px; margin-left: 3px; }
.status-panel { text-align: center; }
.status-panel strong { display: block; margin-top: 8px; color: white; font-size: 15px; letter-spacing: .04em; }
.status-panel.win { animation: panelFlash .45s 3; }
.payout-panel { text-align: right; }

.reel-stage { position: relative; padding: 0 34px; }
.reels {
  height: calc(var(--cell-h) * 3);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  overflow: hidden; border: 5px solid #09251d; border-radius: 12px;
  background: #ccdbb8;
  box-shadow: inset 0 0 24px rgba(0,0,0,.3);
  -webkit-user-select: none;
  user-select: none;
}
.reel-window { overflow: hidden; position: relative; background: var(--cream); }
.reel-window::before, .reel-window::after {
  content: ""; position: absolute; z-index: 4; left: 0; right: 0; height: 35px; pointer-events: none;
}
.reel-window::before { top: 0; background: linear-gradient(#79877880, transparent); }
.reel-window::after { bottom: 0; background: linear-gradient(transparent, #79877880); }
.reel-strip { will-change: transform; }
.symbol {
  height: var(--cell-h); display: grid; place-items: center;
  border-bottom: 1px solid #bdc9ad; color: var(--ink);
  font: 900 67px/1 "Noto Sans JP", sans-serif;
  text-shadow: 2px 3px 0 #cfe2aa;
  position: relative;
}
.symbol::after {
  content: ""; position: absolute; width: 55px; height: 55px; z-index: -1;
  border-radius: 50%; background: rgba(183,215,86,.28);
}
.symbol.dot { color: #2c784d; font-size: 76px; text-shadow: 2px 3px 0 #9fc558; }
.symbol.dot::after { background: rgba(39,121,78,.18); transform: scale(1.25); }
.reel-window.spinning .reel-strip { filter: blur(2px); }
.reel-window.stopped { animation: reelStop .18s ease-out; }
.center-arrow { position: absolute; z-index: 5; top: 50%; transform: translateY(-50%); width: 0; height: 0; }
.center-arrow.left { left: 10px; border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-left: 17px solid var(--orange); }
.center-arrow.right { right: 10px; border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-right: 17px solid var(--orange); }

.payline-layer { position: absolute; inset: 0 34px; z-index: 6; pointer-events: none; }
.payline {
  position: absolute; left: 2%; width: 96%; height: 5px; top: 50%;
  transform-origin: center; background: var(--gold); border-radius: 9px;
  box-shadow: 0 0 0 2px #fff9, 0 0 13px var(--gold);
  animation: linePulse .55s infinite alternate;
}
.payline.row-0 { top: 16.666%; }
.payline.row-2 { top: 83.333%; }
.payline.diag-down { transform: rotate(21deg); }
.payline.diag-up { transform: rotate(-21deg); }
.payline.preview {
  background: #ffffff;
  box-shadow: 0 0 0 2px var(--orange), 0 0 16px #fff;
  animation: previewLine 1.15s ease-out forwards;
}

.stop-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; padding: 14px 40px 4px; }
.stop-button {
  min-height: 58px; border: 3px solid #071f18; border-radius: 11px;
  color: #587468; background: #183f32; font-size: 14px; font-weight: 900; letter-spacing: .1em;
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.2); transition: .15s;
}
.stop-button span { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1px solid currentColor; border-radius: 50%; margin-right: 8px; }
.stop-button kbd { margin-left: 6px; font: 700 9px "DM Sans"; opacity: .65; }
.stop-button:not(:disabled) { cursor: pointer; color: white; background: var(--orange); box-shadow: 0 0 14px #ee724688, inset 0 -5px 0 #b84e2c; }
.stop-button:not(:disabled):active { transform: translateY(3px); box-shadow: inset 0 -2px 0 #b84e2c; }

.control-deck { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 17px 18px 6px; border-top: 1px solid #34594d; margin-top: 10px; }
.bet-area > p { margin: 0 0 8px; color: #86a99a; font-size: 10px; letter-spacing: .15em; font-weight: 800; }
.bet-buttons { display: flex; gap: 7px; }
.bet-buttons button {
  min-width: 82px; padding: 7px 10px; border: 1px solid #547468; border-radius: 8px;
  background: #173c30; color: #91aa9e; cursor: pointer;
}
.bet-buttons b { font-size: 19px; margin-right: 6px; }
.bet-buttons span { font-size: 10px; }
.bet-buttons button.selected { color: var(--deep); background: var(--lime); border-color: var(--lime); box-shadow: 0 0 13px #b9db5755; }
.bet-buttons button:disabled { cursor: default; opacity: .45; }
.multiplier-row { display: flex; align-items: center; gap: 9px; margin-top: 9px; }
.multiplier-row > span { color: #86a99a; font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.multiplier-buttons { display: flex; gap: 5px; }
.multiplier-buttons button {
  min-width: 42px; padding: 4px 8px; border: 1px solid #547468; border-radius: 20px;
  background: #173c30; color: #91aa9e; font-size: 11px; font-weight: 800; cursor: pointer;
}
.multiplier-buttons button.selected { color: var(--deep); background: var(--gold); border-color: var(--gold); }
.multiplier-buttons button:disabled { cursor: default; opacity: .45; }
.spin-button {
  width: 150px; height: 82px; border: 4px solid #09251d; border-radius: 50%;
  background: var(--gold); color: var(--deep); cursor: pointer; font-weight: 900;
  box-shadow: 0 7px 0 #b58425, 0 10px 18px rgba(0,0,0,.26);
}
.spin-button span { display: block; font-size: 25px; line-height: 1; }
.spin-button small { font-size: 9px; letter-spacing: .12em; }
.spin-button kbd { display: block; width: fit-content; margin: 4px auto 0; padding: 1px 8px; border: 1px solid #9e7628; border-radius: 8px; font: 700 8px "DM Sans"; }
.spin-button:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 2px 0 #b58425; }
.spin-button:disabled { filter: grayscale(.8); opacity: .5; cursor: default; }

.rules { display: grid; grid-template-columns: 1.5fr 1fr; gap: 38px; margin: 36px 22px 0; }
.prize-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.prize-list > div { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 9px 12px; border-bottom: 1px solid #9cae91; }
.prize-list b { font-size: 22px; color: var(--green); }
.prize-list small { grid-column: 2; font-size: 8px; color: #668071; }
.sample { font-weight: 900; font-size: 16px; letter-spacing: .1em; }
.jackpot { background: #ffffff5c; border-radius: 8px; }
.jackpot b { color: var(--orange); }
.super-jackpot { grid-column: 1 / -1; }
.super-jackpot .marimo-dot { color: var(--green); font-size: 21px; letter-spacing: .2em; }
.super-jackpot b { color: #d94b2f; font-size: 27px; }
.how-to p:not(.section-label) { margin: 8px 0; font-size: 12px; line-height: 1.7; }

.ranking {
  margin: 34px 22px 0; padding: 22px;
  border: 2px solid #9caf91; border-radius: 16px; background: #f7f2dfaa;
}
.ranking-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.ranking-heading h2 { margin: 0; font: 900 22px "Noto Sans JP"; }
.ranking-heading p:last-child { margin: 7px 0 0; color: #668071; font-size: 11px; }
.ranking-heading p strong { color: var(--green); letter-spacing: .08em; }
#submitScoreButton {
  padding: 12px 18px; border: 2px solid var(--ink); border-radius: 9px;
  background: var(--green); color: white; font-weight: 800; cursor: pointer;
  box-shadow: 0 4px 0 var(--deep);
}
#submitScoreButton:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--deep); }
#submitScoreButton:disabled { opacity: .5; cursor: default; }
.ranking-actions { display: flex; align-items: center; gap: 9px; }
.share-button {
  padding: 11px 15px; border: 2px solid var(--ink); border-radius: 9px;
  background: var(--cream); color: var(--ink); font-weight: 800; cursor: pointer;
  box-shadow: 0 4px 0 #9caf91;
}
.share-button span { margin-right: 5px; font-size: 16px; }
.share-button:active { transform: translateY(3px); box-shadow: 0 1px 0 #9caf91; }
.ranking-message { min-height: 18px; margin: 10px 0 0; color: var(--orange); font-size: 11px; font-weight: 700; }
.ranking-list { list-style: none; margin: 4px 0 0; padding: 0; counter-reset: rank; }
.ranking-list li {
  counter-increment: rank; display: grid; grid-template-columns: 38px 1fr auto; align-items: center;
  min-height: 42px; padding: 7px 10px; border-bottom: 1px solid #bac7ad; font-size: 12px;
}
.ranking-list li::before { content: counter(rank, decimal-leading-zero); color: #7b907f; font-weight: 800; }
.ranking-list li:nth-child(-n+3)::before { color: var(--orange); font-size: 16px; }
.ranking-list .score { color: var(--green); font-size: 17px; font-weight: 900; }
.ranking-list .score small { margin-left: 4px; font-size: 8px; color: #688171; }
.ranking-list li.me { background: #b9db5733; }
.ranking-list li.ranking-empty { display: block; color: #789080; text-align: center; }
.ranking-list li.ranking-empty::before { content: none; }

.result-burst {
  position: fixed; inset: 0; z-index: 20; display: grid; place-content: center; text-align: center;
  pointer-events: none; opacity: 0; background: radial-gradient(circle, #f5cb48cc 0, transparent 40%);
}
.result-burst.show { animation: burst 1.3s ease-out; }
.result-burst span { font-weight: 900; font-size: clamp(50px, 12vw, 120px); color: white; -webkit-text-stroke: 3px var(--orange); transform: rotate(-5deg); }
.result-burst strong { font-size: 34px; color: var(--deep); }

.ad-unit {
  width: 100%;
  margin: 32px auto 0;
  overflow: hidden;
}

.site-footer {
  margin: 52px -18px -45px;
  color: #dce9d8;
  background: var(--deep);
  border-top: 6px solid var(--green);
}
.footer-inner {
  width: min(960px, calc(100% - 36px));
  margin: auto;
  padding: 34px 20px 26px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 25px 40px;
  align-items: center;
}
.footer-brand { display: flex; align-items: center; gap: 13px; }
.footer-mark { width: 48px; height: 48px; border-color: #dce9d8; flex: 0 0 auto; }
.footer-mark span { width: 30px; height: 30px; }
.footer-brand strong { font: 900 20px "Noto Sans JP"; letter-spacing: -.05em; }
.footer-brand p { margin: 4px 0 0; color: #88aa99; font-size: 10px; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 22px; }
.footer-nav a {
  color: #dce9d8; text-decoration: none; font-size: 11px; font-weight: 800;
  border-bottom: 1px solid transparent;
}
.footer-nav a:hover, .footer-nav a:focus-visible { color: var(--lime); border-color: var(--lime); }
.footer-note {
  margin: 0; padding-top: 18px; border-top: 1px solid #315449;
  color: #88aa99; font-size: 10px; line-height: 1.7;
}
.copyright {
  margin: 0; padding-top: 18px; border-top: 1px solid #315449;
  color: #688b7c; text-align: right; font-size: 10px;
}

@keyframes reelStop { 50% { transform: translateY(8px); } }
@keyframes panelFlash { 50% { background: #4a6c28; } }
@keyframes linePulse { to { opacity: .5; } }
@keyframes previewLine {
  0% { opacity: 0; transform-origin: center; }
  15%, 65% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes burst { 0% { opacity: 0; transform: scale(.5); } 25%, 70% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.4); } }

@media (max-width: 700px) {
  :root { --cell-h: 88px; }
  body { padding: 18px 8px 35px; }
  .brand { margin-inline: 10px; }
  .brand-mark { width: 49px; height: 49px; }
  .brand-mark span { width: 31px; height: 31px; }
  .brand h1 { font-size: 29px; }
  .brand h1 span { font-size: 14px; }
  .eyebrow { font-size: 7px; }
  .machine { padding: 9px; border-radius: 20px; }
  .machine-top { grid-template-columns: 1fr 1.8fr 1fr; gap: 5px; }
  .machine-top > div { min-height: 59px; padding: 7px; }
  .machine-top strong { font-size: 21px; }
  .status-panel strong { font-size: 10px; margin-top: 5px; }
  .reel-stage { padding-inline: 16px; }
  .reels { gap: 4px; border-width: 3px; }
  .symbol { font-size: 49px; }
  .symbol.dot { font-size: 58px; }
  .center-arrow.left { left: 0; }
  .center-arrow.right { right: 0; }
  .payline-layer { inset-inline: 16px; }
  .stop-row { padding-inline: 20px; gap: 6px; }
  .stop-button { min-height: 48px; font-size: 10px; }
  .stop-button span { display: none; }
  .stop-button kbd { margin-left: 3px; }
  .control-deck { padding-inline: 7px; gap: 8px; }
  .bet-buttons button { min-width: 56px; padding: 7px 3px; }
  .bet-buttons b { display: block; margin: 0; }
  .bet-buttons span { font-size: 8px; }
  .multiplier-row { gap: 5px; }
  .multiplier-row > span { font-size: 8px; }
  .multiplier-buttons button { min-width: 35px; padding-inline: 5px; }
  .spin-button { width: 104px; height: 69px; flex: 0 0 auto; }
  .spin-button span { font-size: 20px; }
  .rules { grid-template-columns: 1fr; margin-inline: 10px; gap: 25px; }
  .prize-list { grid-template-columns: 1fr 1fr; }
  .ranking { margin-inline: 10px; padding: 16px; }
  .ranking-heading { align-items: flex-start; }
  .ranking-heading h2 { font-size: 18px; }
  .ranking-actions { flex-direction: column; align-items: stretch; }
  .share-button { padding: 8px 10px; font-size: 11px; }
  #submitScoreButton { max-width: 130px; padding: 10px; font-size: 11px; }
  .site-footer { margin-inline: -8px; }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; padding-inline: 10px; }
  .footer-nav { justify-content: flex-start; }
  .footer-note, .copyright { padding-top: 15px; }
  .copyright { border-top: 0; padding-top: 0; text-align: left; }
}

@media (max-width: 400px) {
  :root { --cell-h: 76px; }
  .brand h1 span, .sound-button { display: none; }
  .machine-top { grid-template-columns: 1fr 1.6fr 1fr; }
  .machine-top span { font-size: 7px; }
  .symbol { font-size: 42px; }
  .symbol.dot { font-size: 49px; }
}
