/* Hamamza Bonanza · Responsive arcade interface · UTF-8 */
:root {
  color-scheme: dark;
  --ink: #fff5fd;
  --muted: #c9b5d5;
  --surface: #2a193d;
  --edge: #745087;
  --pink: #ffa2cc;
  --lime: #d7f18a;
  font-family: "all-round-gothic", "noka", "Trebuchet MS", system-ui, sans-serif;
  color: var(--ink);
  background: #160e28;
  font-size: 15px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-width: 320px; min-height: 100vh;
  background:
    radial-gradient(ellipse at 52% -20%, #704181 0, transparent 46%),
    radial-gradient(ellipse at 100% 44%, #422449 0, transparent 40%),
    radial-gradient(ellipse at -15% 80%, #3a3252 0, transparent 36%), #160e28;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .16; background-image: radial-gradient(#fff 0.55px, transparent 0.55px);
  background-size: 18px 18px; mask-image: linear-gradient(#0008, transparent 90%);
}
button, select { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .5; }
button:focus-visible, select:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
.ambient { position: fixed; border-radius: 50%; filter: blur(90px); opacity: .23; pointer-events: none; z-index: 0; }
.ambient-one { width: 400px; height: 400px; top: 30%; left: -300px; background: #eb5cac; }
.ambient-two { width: 300px; height: 300px; bottom: 2%; right: -220px; background: #a2bf57; }
.app-shell { position: relative; z-index: 1; max-width: 1540px; margin: 0 auto; padding: 12px clamp(12px, 2.5vw, 38px) 24px; }
.topbar { height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.brand { display: flex; align-items: center; gap: 9px; font-family: "noka", "all-round-gothic", sans-serif; line-height: .9; letter-spacing: .04em; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--lime); color: #291936; font-size: 29px; transform: rotate(-9deg); box-shadow: 0 3px 0 #8a9f53, 0 0 22px #d7f18a20; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 21px; letter-spacing: .015em; }
.brand small { margin-top: 5px; color: var(--pink); font-size: 10px; letter-spacing: .3em; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.fiction-badge { padding: 8px 12px; border: 1px solid #78824b; border-radius: 999px; color: var(--lime); font-size: 10px; font-weight: 800; letter-spacing: .1em; white-space: nowrap; }
.icon-button { border: 1px solid var(--edge); background: #362248; color: #fff; border-radius: 10px; padding: 8px 11px; font-weight: 850; }
.icon-button span { margin-left: 4px; font-size: 12px; font-weight: 650; }
.icon-button:hover, .auto-button:hover:not(:disabled) { border-color: #df9cc9; background: #4c315e; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(285px, 318px); gap: clamp(12px, 1.5vw, 20px); align-items: stretch; }
.machine { min-width: 0; display: flex; flex-direction: column; }
.machine-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 79px; margin: 0 2px 9px; }
.machine-title-block { flex: 1 1 auto; min-width: 0; }
.eyebrow { font-family: "exo", "all-round-gothic", sans-serif; font-size: 10px; font-weight: 800; letter-spacing: .15em; color: var(--lime); }
.machine-head .eyebrow span { color: var(--pink); margin: 0 4px; }
.machine-head h1 {
  margin: 4px 0 0; font-family: "noka", "all-round-gothic", system-ui, sans-serif;
  font-weight: 900; font-size: clamp(30px, 3.4vw, 53px); line-height: .96; letter-spacing: -.055em;
  text-shadow: 0 4px 0 #5e2a65; white-space: nowrap;
}
.machine-head h1 em { font-style: normal; color: var(--pink); }
.machine-head-note { flex: 0 1 260px; text-align: right; }
.machine-head-note p { margin: 0 0 7px; color: #e1cde9; font-size: 12px; font-weight: 700; }
.machine-meta { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.machine-meta span { display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; border: 1px solid #705179; background: #342044ad; border-radius: 999px; color: #e0d1e7; white-space: nowrap; font-size: 10px; font-weight: 750; }
.machine-meta span:first-child { color: #e9f7af; border-color: #84915d; }
.board-frame {
  position: relative; isolation: isolate; padding: 8px; border: 2px solid #e8a2ca; border-radius: 21px;
  background: linear-gradient(135deg, #e8a2c9, #a45a9f 38%, #663b81 80%, #493266);
  box-shadow: 0 7px 0 #46244e, 0 16px 24px #0a041b80, inset 0 2px 1px #ffe8f3a6;
}
.board-top, .board-bottom {
  height: 24px; display: flex; align-items: center; gap: 7px; padding: 0 9px;
  font-family: "exo", "all-round-gothic", sans-serif; font-size: 10px; font-weight: 900; letter-spacing: .11em;
}
.board-top { color: #2b1b33; }
.board-dot { display: inline-block; flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: #ddf892; box-shadow: 0 0 11px #edffb8; animation: led 2.5s ease-in-out infinite; }
.board-deco { margin-left: auto; color: #ffeff8; }
.board-bottom { justify-content: space-between; color: #ffe0f1; }
.grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(4px, .6vw, 8px); padding: clamp(5px, .7vw, 9px);
  border: 2px solid #ffbfe2; border-radius: 15px; background: #291738;
  box-shadow: inset 0 7px 16px #13091ec9;
}
.tile {
  min-width: 0; height: clamp(78px, 11.6vh, 124px); position: relative; display: grid; place-items: center;
  overflow: hidden; border-radius: 13px; border: 1px solid #8b638e;
  background: radial-gradient(ellipse at 50% 25%, color-mix(in srgb, var(--symbol-shell) 33%, #77588f), #483057 76%, #322045);
  box-shadow: inset 0 2px 0 #fff2, 0 3px 0 #1e1029; transform: translateZ(0);
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.tile::before { content: ""; position: absolute; inset: 7% 15% 15%; border-radius: 50%; background: #fff2; filter: blur(14px); opacity: .35; }
.tile svg { width: min(94%, 116px); height: calc(100% - 6px); z-index: 1; position: relative; overflow: visible; filter: drop-shadow(0 5px 3px #1d0d2ea1); transition: transform .2s ease; }
.tile:hover:not(.spinning) svg { transform: translateY(-3px) scale(1.045) rotate(-2deg); }
.tile-name {
  position: absolute; bottom: 1px; left: 3px; right: 3px; z-index: 2; text-align: center;
  padding: 3px 1px 2px; border-radius: 5px; color: #fff4fd; font-size: 9px; font-weight: 850;
  letter-spacing: .01em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(90deg, transparent, #24152dba 14%, #24152dd1 86%, transparent);
}
.tile.win { border-color: var(--lime); background: radial-gradient(ellipse at 45% 40%, #8f8249, #5c3d67 77%); box-shadow: inset 0 0 0 2px #dff299, 0 0 19px #ddf59075; animation: winPulse .7s ease both; }
.tile.win svg { transform: scale(1.07); }
.tile.spinning svg { animation: wobble .24s linear infinite; }
.tile.spinning .tile-name { opacity: .3; }
.result {
  display: flex; align-items: center; gap: 11px; margin: 13px 2px 0; min-height: 47px; padding: 9px 13px;
  border-radius: 12px; border: 1px solid #77527b; background: #2b1b3e; color: #f4e7f7;
  font-size: 13px; font-weight: 750; line-height: 1.35;
}
.result-icon { flex: 0 0 auto; color: var(--lime); font-size: 22px; }
.result.positive { color: #ebfbb3; background: #344039; border-color: #b4d079; box-shadow: 0 0 22px #bcde5830; }
.result.positive .result-icon { animation: pop .45s ease both; }
.result.negative { color: #e5d1e9; }
.control-panel { align-self: start; overflow: hidden; margin-top: 0; border: 1px solid #724b7b; border-radius: 18px; background: var(--surface); box-shadow: 0 12px 28px #0b061a8c; }
.balance-card { display: flex; justify-content: space-between; align-items: end; gap: 8px; padding: 13px 16px 12px; color: #273323; background: linear-gradient(120deg, #e5f9a9, #b0d478 64%, #a0c86f); }
.small-label { font-family: "exo", "all-round-gothic", sans-serif; font-size: 11px; font-weight: 800; letter-spacing: .11em; }
.balance-value { display: flex; align-items: center; gap: 7px; margin-top: 2px; font-family: "exo", "all-round-gothic", sans-serif; font-weight: 900; font-size: 30px; line-height: 1.1; letter-spacing: -.035em; }
.coin-symbol { font-size: 26px; color: #435a2c; }
.coin-label { padding-bottom: 2px; font-size: 10px; font-weight: 750; white-space: nowrap; opacity: .76; }
.panel-inner { padding: 14px 15px 13px; }
.panel-row { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-bottom: 8px; }
.helper-label { color: #bca6c9; font-size: 11px; font-weight: 700; }
.bet-options { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 6px; margin-bottom: 12px; }
.bet-option { border: 1px solid #705080; border-radius: 9px; background: #38244c; color: #f4e3f7; padding: 9px 2px; font-family: "exo", sans-serif; font-size: 15px; font-weight: 850; transition: transform .15s, background .15s; }
.bet-option:hover:not(:disabled) { background: #574069; transform: translateY(-2px); }
.bet-option.active { border-color: #ffe3f1; background: #f5a6d0; color: #311736; box-shadow: 0 3px 0 #94567b; }
.roll-button {
  display: flex; align-items: center; justify-content: space-around; gap: 4px; width: 100%;
  padding: 12px 10px 10px; border: 0; border-bottom: 4px solid #b54e8a; border-radius: 12px;
  color: #35162b; background: linear-gradient(180deg, #ffc1df, #f588c2 48%, #ea6aab);
  box-shadow: 0 5px 16px #ee80b04d; font-family: "noka", "all-round-gothic", sans-serif;
  font-size: 21px; font-weight: 900; letter-spacing: .04em; transition: filter .16s, transform .16s;
}
.roll-button:hover:not(:disabled) { filter: brightness(1.1); }
.roll-button:active:not(:disabled) { transform: translateY(3px); border-bottom-width: 1px; }
.roll-button.is-rolling .roll-spark { animation: spin .55s linear infinite; }
.roll-spark { font-size: 20px; }
.auto-section { margin-top: 15px; }
.auto-controls { display: grid; grid-template-columns: 87px minmax(0, 1fr); gap: 7px; }
.auto-controls select, .auto-button { min-width: 0; padding: 9px 8px; border: 1px solid #72537f; border-radius: 9px; background: #3b2850; color: #fff0fa; font-size: 12px; font-weight: 750; }
.auto-controls select { appearance: none; padding-right: 18px; background-image: linear-gradient(45deg, transparent 50%, #ddc8e6 50%), linear-gradient(135deg, #ddc8e6 50%, transparent 50%); background-position: calc(100% - 12px) 51%, calc(100% - 7px) 51%; background-repeat: no-repeat; background-size: 5px 5px; }
.auto-button { background: #503660; }
.auto-button.running { background: var(--lime); border-color: #e6f5a8; color: #2e342c; }
.divider { height: 1px; margin: 13px 0 10px; background: #5d406c; }
.stat-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #c6afd0; font-size: 12px; margin: 8px 0; }
.stat-row strong { color: white; font-family: "exo", sans-serif; font-size: 13px; font-weight: 850; }
.stat-row strong.up { color: var(--lime); }
.stat-row strong.down { color: #ffa2c8; }
.reset-button { display: flex; justify-content: space-between; width: 100%; margin-top: 13px; padding: 11px 0 0; border: 0; border-top: 1px solid #5d406c; background: none; color: #c7b1d2; text-align: left; font-size: 12px; font-weight: 700; }
.reset-button:hover { color: white; }
.panel-foot { padding: 10px 15px; background: #221430; color: #bba5c7; font-size: 10px; line-height: 1.45; }
.crew-section { margin: 24px 0 22px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.section-head h2, .dialog-top h2 { margin: 3px 0 0; font-family: "noka", "all-round-gothic", sans-serif; font-size: 24px; letter-spacing: -.025em; }
.text-button { padding: 5px 1px; border: 0; background: none; color: #ffc0e0; font-size: 12px; font-weight: 800; }
.text-button:hover { text-decoration: underline; }
.text-button span { font-size: 15px; }
.crew-list { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 9px; }
.crew-card { display: grid; grid-template-columns: 74px minmax(0,1fr); align-items: center; gap: 7px; padding: 7px; min-width: 0; border: 1px solid #684976; border-radius: 13px; background: linear-gradient(135deg, #352148, #291c3d); transition: border-color .2s, transform .2s; }
.crew-card:hover { transform: translateY(-3px); border-color: #dda5ce; }
.crew-art { aspect-ratio: 1; display: grid; place-items: center; border-radius: 9px; background: radial-gradient(ellipse at 50% 25%, #6e507d, #403050); }
.crew-art svg { width: 95%; height: 95%; filter: drop-shadow(0 4px 2px #211226); }
.crew-info { min-width: 0; }
.crew-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.crew-card .role { display: block; color: #cab3d5; font-size: 10px; line-height: 1.3; }
.crew-card .tier { display: block; margin-top: 5px; color: var(--lime); font-family: "exo", sans-serif; font-size: 11px; font-weight: 900; }
footer { border-top: 1px solid #51355d; padding: 17px; color: #a793b1; text-align: center; font-size: 10px; font-weight: 800; letter-spacing: .13em; }
footer span { margin: 0 6px; color: var(--lime); }
.rules-dialog { width: min(740px, calc(100% - 24px)); max-height: min(90vh, 840px); overflow: auto; padding: 24px; border: 2px solid #ba7cad; border-radius: 20px; background: #2c1c3e; color: #fff2fc; box-shadow: 0 20px 90px #0e071ce0; }
.rules-dialog::backdrop { background: #10071ee0; backdrop-filter: blur(5px); }
.dialog-top { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.dialog-close { padding: 3px 10px; border: 1px solid #8e6b97; border-radius: 10px; background: #50335e; color: #fff; font-size: 24px; line-height: 1; }
.rules-dialog p { color: #e3cee9; line-height: 1.5; }
.table-wrap { overflow-x: auto; border: 1px solid #745481; border-radius: 11px; }
.rules-dialog table { width: 100%; min-width: 590px; border-collapse: collapse; text-align: right; }
.rules-dialog th:first-child, .rules-dialog td:first-child { text-align: left; }
.rules-dialog th, .rules-dialog td { padding: 9px 10px; border-bottom: 1px solid #51385e; font-size: 13px; }
.rules-dialog th { background: #493354; color: #e9eeac; font-size: 12px; }
.rules-dialog tr:last-child td { border-bottom: 0; }
.rules-dialog td:first-child { font-weight: 750; }
.rules-note { font-size: 12px; }
.rules-warning { padding: 12px 14px; border-radius: 10px; background: #38483a; color: #e2f8b9; font-size: 12px; line-height: 1.45; }
.win-burst { position: absolute; inset: 0; z-index: 3; overflow: hidden; pointer-events: none; border-radius: inherit; }
.win-burst i { --dx: 0px; --dy: -90px; --rot: 1turn; position: absolute; top: 52%; left: 50%; width: 7px; height: 11px; border-radius: 2px; background: var(--pink); animation: confetti .85s ease-out both; }
.win-burst i:nth-child(3n) { background: var(--lime); }
.win-burst i:nth-child(4n) { background: #c4b5fd; }
@keyframes led { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes wobble { 0%,100% { transform: translateY(-5px) rotate(-6deg); } 50% { transform: translateY(5px) rotate(6deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(.65); } 65% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes winPulse { 0% { filter: brightness(1.5); } 100% { filter: brightness(1); } }
@keyframes confetti { 0% { transform: translate(-50%,0) scale(.4); opacity: 1; } 100% { transform: translate(var(--dx),var(--dy)) rotate(var(--rot)) scale(.7); opacity: 0; } }
@media (min-width: 1340px) {
  .crew-card { grid-template-columns: 81px minmax(0,1fr); }
}
@media (max-width: 1270px) {
  .crew-card { grid-template-columns: 1fr; text-align: center; }
  .crew-art { max-height: 80px; margin: auto; width: 100%; }
  .crew-info { min-width: 0; }
  .machine-head-note { flex-basis: 180px; }
}
@media (max-width: 1090px) {
  .game-layout { grid-template-columns: minmax(0, 1fr) 275px; gap: 12px; }
  .machine-head { gap: 9px; }
  .machine-head-note { flex-basis: 150px; }
  .machine-head h1 { font-size: clamp(28px, 3.15vw, 40px); }
  .machine-meta span:last-child { display: none; }
  .tile { height: clamp(70px, 10.6vh, 109px); }
}
@media (max-width: 800px) {
  .game-layout { grid-template-columns: 1fr; }
  .machine-head { min-height: 66px; }
  .machine-head h1 { font-size: clamp(33px, 6vw, 51px); }
  .machine-head-note { flex-basis: 245px; }
  .tile { height: clamp(65px, 11vh, 118px); }
  .control-panel { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.7fr); }
  .balance-card { display: flex; align-items: center; flex-direction: column; justify-content: center; text-align: center; }
  .panel-inner { grid-column: 2; grid-row: 1 / span 2; }
  .panel-foot { grid-column: 1; }
  .crew-section { margin-top: 23px; }
}
@media (max-width: 620px) {
  .app-shell { padding: 10px 12px 22px; }
  .topbar { height: 48px; margin-bottom: 8px; }
  .fiction-badge { display: none; }
  .machine-head { align-items: start; gap: 8px; }
  .machine-head h1 { font-size: clamp(28px, 6.5vw, 42px); }
  .machine-head-note { flex-basis: 145px; padding-top: 8px; }
  .machine-head-note p { font-size: 10px; }
  .machine-meta span { padding: 4px 6px; font-size: 9px; }
  .machine-meta span:last-child { display: none; }
  .board-frame { padding: 6px; border-radius: 16px; }
  .grid { gap: 4px; padding: 5px; border-radius: 11px; }
  .tile { height: clamp(57px, 10vh, 92px); border-radius: 9px; }
  .tile-name { font-size: 8px; padding: 2px 0; }
  .board-top, .board-bottom { padding: 0 5px; font-size: 9px; }
  .result { margin-top: 10px; }
  .crew-list { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 6px; }
  .crew-card { padding: 6px; }
  .control-panel { display: block; }
  .balance-card { flex-direction: row; text-align: left; justify-content: space-between; align-items: end; }
  .panel-inner, .panel-foot { display: block; }
}
@media (max-width: 400px) {
  .brand-mark { width: 34px; height: 34px; }
  .brand strong { font-size: 17px; }
  .icon-button span { display: none; }
  .machine-head { min-height: 74px; }
  .machine-head h1 { font-size: 27px; white-space: normal; }
  .machine-head .eyebrow { font-size: 8px; }
  .machine-head-note { flex-basis: 124px; }
  .tile-name { font-size: 7px; }
  .crew-list { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-height: 760px) and (min-width: 801px) {
  .tile { height: clamp(63px, 10.1vh, 90px); }
  .machine-head { min-height: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
