:root {
  --pink: #f3a6b8;
  --pink-soft: #ffd6df;
  --pink-light: #ffe8ed;
  --pink-dark: #d84a67;
  --green: #38543b;
  --green-deep: #233c28;
  --lime: #b8d96a;
  --lime-bright: #c9e978;
  --cream: #fff8ed;
  --paper: #fffaf4;
  --ink: #172119;
  --muted: #6d736d;
  --line: rgba(56, 84, 59, 0.14);
  --shadow: 0 14px 34px rgba(79, 40, 48, 0.13);
  --shadow-soft: 0 7px 18px rgba(79, 40, 48, 0.1);
  --round-font: "Arial Rounded MT Bold", "Trebuchet MS", ui-rounded, system-ui, sans-serif;
  --text-font: "Nunito", "Avenir Next", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: #f9efeb;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 18%, rgba(243, 166, 184, 0.28), transparent 26rem),
    radial-gradient(circle at 85% 82%, rgba(184, 217, 106, 0.23), transparent 24rem),
    #f9efeb;
  font-family: var(--text-font);
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

button,
input,
select {
  color: inherit;
  font: inherit;
  touch-action: manipulation;
}

input,
select,
textarea {
  font-size: 16px;
}

button {
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(216, 74, 103, 0.32);
  outline-offset: 3px;
}

button:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
}

svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

svg .fill,
.fill {
  fill: currentColor;
  stroke: none;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 190px;
  height: 190px;
  border-radius: 44% 56% 67% 33% / 41% 42% 58% 59%;
  filter: blur(1px);
  opacity: 0.45;
  transform: rotate(20deg);
}

.ambient-one {
  top: 5vh;
  left: -75px;
  background: var(--pink-soft);
}

.ambient-two {
  right: -70px;
  bottom: 4vh;
  background: #dceaae;
  transform: rotate(-20deg);
}

.app-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 15%, rgba(255,255,255,0.58), transparent 18rem),
    linear-gradient(168deg, #ffdbe3 0%, #ffcbd7 72%, #f8b7c7 100%);
}

.topbar {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  min-height: 72px;
  padding: max(12px, env(safe-area-inset-top)) 22px 8px;
}

.topbar.hidden {
  display: none;
}

.topbar-title {
  font-family: var(--round-font);
  font-size: 0.84rem;
  letter-spacing: 0.07em;
  text-align: center;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 180ms ease;
}

.topbar-title.visible {
  opacity: 1;
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border-radius: 15px;
  background: transparent;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.34);
}

.view {
  display: none;
  flex: 1;
  min-height: 0;
  padding: 18px 24px 116px;
  animation: view-in 240ms ease both;
}

.view.active {
  display: block;
}

.view.game-view.active {
  display: flex;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.home-view {
  padding-top: 8px;
}

.brand {
  width: max-content;
  margin: 9px auto 26px;
  color: var(--green);
  font-family: var(--round-font);
  font-weight: 900;
  line-height: 0.8;
  letter-spacing: -0.065em;
  text-align: center;
  transform: rotate(-1deg);
  user-select: none;
}

.brand-line {
  white-space: nowrap;
}

.brand-roll {
  font-size: clamp(4.2rem, 20vw, 6.4rem);
}

.brand-pigs {
  margin-top: 10px;
  color: #9bc83d;
  font-size: clamp(2.75rem, 13.4vw, 4.35rem);
  letter-spacing: -0.045em;
}

.brand-snout {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-evenly;
  width: 0.94em;
  height: 0.8em;
  margin: 0 0.01em;
  border-radius: 50%;
  background: var(--pink);
  vertical-align: 0.05em;
  box-shadow: inset 0 -5px 0 rgba(216, 74, 103, 0.08);
}

.brand-snout i {
  width: 0.13em;
  height: 0.24em;
  border-radius: 50%;
  background: #8f2940;
}

.brand-squiggle {
  height: 26px;
  margin-top: 8px;
  color: #ed7e98;
  font-family: cursive;
  font-size: 3.1rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.6;
  transform: rotate(8deg);
}

.home-actions {
  display: grid;
  gap: 12px;
}

.action-card {
  display: grid;
  grid-template-columns: 54px 1fr 24px;
  gap: 13px;
  align-items: center;
  width: 100%;
  min-height: 82px;
  padding: 12px 16px;
  border: 1px solid rgba(56, 84, 59, 0.1);
  border-radius: 25px;
  background: rgba(255, 248, 237, 0.91);
  box-shadow: var(--shadow-soft);
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.action-card-primary {
  border-color: rgba(82, 117, 39, 0.16);
  background: linear-gradient(135deg, var(--lime-bright), #b4dc5d);
}

.action-card strong,
.last-game-card strong {
  display: block;
  font-family: var(--round-font);
  font-size: 0.97rem;
  letter-spacing: 0.012em;
  text-transform: uppercase;
}

.action-card small,
.last-game-card small {
  display: block;
  margin-top: 3px;
  color: rgba(23, 33, 25, 0.7);
  font-size: 0.76rem;
  font-weight: 650;
}

.action-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 18px;
  color: var(--green);
  background: rgba(243, 166, 184, 0.35);
}

.action-icon-dark {
  color: #fff;
  background: var(--green-deep);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.15);
}

.action-arrow {
  width: 20px;
  height: 20px;
}

.last-game-card {
  display: grid;
  grid-template-columns: 48px 1fr 24px;
  gap: 12px;
  align-items: center;
  min-height: 92px;
  margin-top: 14px;
  padding: 15px 16px;
  border: 1px solid rgba(216, 74, 103, 0.18);
  border-radius: 24px;
  background: rgba(255, 232, 237, 0.74);
}

.last-game-card.empty {
  grid-template-columns: 48px 1fr;
}

.last-game-card .action-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--cream);
}

.last-game-score {
  color: var(--green);
  font-weight: 850;
}

.home-note {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin: 23px 0 4px;
  color: rgba(56, 84, 59, 0.72);
  font-size: 0.78rem;
  font-weight: 750;
  text-align: center;
}

.home-note svg {
  width: 19px;
  height: 19px;
  color: var(--pink-dark);
}

.bottom-nav {
  position: absolute;
  z-index: 10;
  right: 12px;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-height: 78px;
  padding: 8px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  background: linear-gradient(145deg, #395d3e, #26432d);
  box-shadow: 0 12px 28px rgba(27, 57, 33, 0.25);
}

.bottom-nav.hidden {
  display: none;
}

.bottom-nav button {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-width: 0;
  padding: 5px 2px;
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.7);
  background: transparent;
  font-size: 0.68rem;
  font-weight: 750;
}

.bottom-nav button.active {
  color: var(--lime-bright);
  background: rgba(255, 255, 255, 0.08);
}

.bottom-nav svg {
  width: 25px;
  height: 25px;
}

.game-view {
  flex-direction: column;
  padding: max(10px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  overflow-y: auto;
}

.game-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  margin: 0 0 12px;
  text-align: center;
}

.game-header span,
.game-header small {
  display: block;
}

.game-header span {
  font-family: var(--round-font);
  font-size: 1.02rem;
}

.game-header small {
  margin-top: 2px;
  color: rgba(23, 33, 25, 0.6);
  font-size: 0.69rem;
  font-weight: 700;
}

.scoreboard {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 42px;
  margin: 0 2px 12px;
}

.scoreboard::after {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 50%;
  color: var(--green-deep);
  background: var(--pink);
  box-shadow: 0 5px 12px rgba(121, 41, 62, 0.18);
  content: "VS";
  font-family: var(--round-font);
  font-size: 0.76rem;
  transform: translate(-50%, -50%);
}

.scoreboard.multiplayer {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.scoreboard[data-player-count="4"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.scoreboard.multiplayer::after {
  display: none;
}

.score-card {
  position: relative;
  padding: 11px 10px 10px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 25px;
  background: rgba(255, 248, 237, 0.93);
  box-shadow: var(--shadow-soft);
  text-align: center;
  transition: border-color 180ms ease, transform 180ms ease;
}

.score-card.current {
  border-color: var(--green);
  transform: translateY(-2px);
}

.score-card.current::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 5px;
  background: var(--green);
  content: "";
}

.score-card.eliminated {
  opacity: 0.48;
  filter: grayscale(0.45);
}

.scoreboard.multiplayer .score-card {
  min-width: 0;
  padding: 8px 5px 7px;
  border-radius: 19px;
}

.scoreboard.multiplayer .score-card .avatar {
  width: 35px;
  height: 35px;
  margin-bottom: 3px;
  font-size: 1.15rem;
}

.scoreboard.multiplayer .score-name {
  font-size: 0.68rem;
}

.scoreboard.multiplayer .score-value {
  font-size: clamp(1.6rem, 8vw, 2.4rem);
}

.score-status {
  display: block;
  margin-top: 1px;
  color: var(--pink-dark);
  font-size: 0.48rem;
  font-weight: 850;
  text-transform: uppercase;
}

.score-card .avatar {
  width: 49px;
  height: 49px;
  margin: 0 auto 5px;
}

.score-name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  font-family: var(--round-font);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-value {
  display: block;
  margin-top: 0;
  color: var(--green-deep);
  font-family: var(--round-font);
  font-size: clamp(2.7rem, 13vw, 4.25rem);
  line-height: 1.05;
}

.turn-label {
  width: max-content;
  max-width: 86%;
  margin: 1px auto 10px;
  padding: 8px 25px 7px;
  overflow: hidden;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12);
  font-family: var(--round-font);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.turn-panel {
  flex: 1;
  padding: 17px 17px 15px;
  border: 1px solid rgba(83, 48, 35, 0.1);
  border-radius: 30px;
  background: rgba(255, 248, 237, 0.95);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-family: var(--round-font);
  font-size: 0.7rem;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.turn-score-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 68px;
}

.turn-score {
  min-width: 104px;
  color: var(--green-deep);
  font-family: var(--round-font);
  font-size: 4.65rem;
  line-height: 0.9;
}

.score-rays {
  color: var(--pink);
  font-size: 1.8rem;
  transform: rotate(-20deg);
}

.score-rays-right {
  transform: rotate(20deg);
}

.throw-count {
  display: inline-block;
  min-width: 90px;
  margin: 4px 0 14px;
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--green-deep);
  background: #e7efc3;
  font-size: 0.69rem;
  font-weight: 800;
}

.score-entry[hidden] {
  display: none;
}

.entry-instruction {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.score-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 330px;
  margin: 0 auto;
}

.score-keypad button {
  min-height: 47px;
  border: 1px solid rgba(56, 84, 59, 0.1);
  border-radius: 15px;
  color: var(--green-deep);
  background: linear-gradient(145deg, #d0ed83, #b4d963);
  box-shadow: inset 0 -3px 0 rgba(84, 117, 29, 0.13), 0 4px 9px rgba(74, 98, 32, 0.07);
  font-family: var(--round-font);
  font-size: 1.12rem;
}

.score-keypad .keypad-action {
  color: var(--pink-dark);
  background: var(--pink-light);
  box-shadow: inset 0 -3px 0 rgba(216, 74, 103, 0.09);
}

.pig-selection-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.pig-summary-button {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 7px;
  align-items: center;
  min-height: 50px;
  padding: 5px 9px;
  border: 1px solid rgba(56, 84, 59, 0.13);
  border-radius: 15px;
  background: #fff;
  text-align: left;
}

.pig-summary-button.active {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}

.pig-summary-button.complete {
  background: #f0f5dd;
}

.pig-summary-button .pig-pose {
  width: 42px;
  height: 34px;
}

.pig-summary-button strong,
.pig-summary-button small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pig-summary-button strong {
  font-family: var(--round-font);
  font-size: 0.66rem;
}

.pig-summary-button small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 750;
}

.pig-summary-placeholder {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--pink-dark);
  background: var(--pink-light);
  font-family: var(--round-font);
}

.pig-figures-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.pig-figure-button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 87px;
  padding: 4px 3px 6px;
  border: 1px solid rgba(56, 84, 59, 0.1);
  border-radius: 16px;
  background: #fff;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.pig-figure-button:hover,
.pig-figure-button.selected {
  border-color: var(--green);
  background: #eef5d7;
}

.pig-figure-button strong,
.pig-figure-button small {
  display: block;
}

.pig-figure-button strong {
  font-family: var(--round-font);
  font-size: 0.6rem;
  line-height: 1.08;
}

.pig-figure-button small {
  margin-top: 2px;
  color: var(--pink-dark);
  font-size: 0.55rem;
  font-weight: 850;
}

.pig-pose {
  width: 61px;
  height: 43px;
  overflow: visible;
  color: var(--green-deep);
  stroke-width: 2.4;
}

.pig-pose .pig-body,
.pig-pose .pig-head {
  fill: var(--pink);
}

.pig-pose .pig-snout {
  fill: var(--pink-soft);
}

.pig-pose .pig-mark {
  fill: var(--pink-dark);
  stroke: none;
}

.pig-pose .pig-eye {
  fill: var(--green-deep);
  stroke: none;
}

.pig-pose .pig-shape {
  transform-box: fill-box;
  transform-origin: center;
}

.pig-pose-side-dot .pig-legs,
.pig-pose-side-blank .pig-legs {
  opacity: 0.3;
  transform: scaleY(0.35);
  transform-origin: top;
}

.pig-pose-razorback .pig-shape {
  transform: rotate(180deg);
}

.pig-pose-snouter .pig-shape {
  transform: rotate(67deg) translate(2px, -2px);
}

.pig-pose-jowler .pig-shape {
  transform: rotate(42deg) translate(1px, 2px);
}

.roll-preview {
  min-height: 41px;
  margin-top: 9px;
  padding: 8px 10px;
  border-radius: 13px;
  color: var(--green);
  background: #f1f5df;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.35;
}

.roll-preview.pig-out {
  color: var(--pink-dark);
  background: var(--pink-light);
}

.confirm-roll-button {
  width: 100%;
  min-height: 44px;
  margin-top: 7px;
  border-radius: 14px;
  color: var(--green-deep);
  background: linear-gradient(145deg, #cce97c, #b2d85e);
  box-shadow: inset 0 -3px 0 rgba(83, 112, 34, 0.13);
  font-family: var(--round-font);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.confirm-roll-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.35);
  opacity: 0.48;
}

.rare-cases {
  margin-top: 8px;
  border-top: 1px dashed rgba(56, 84, 59, 0.2);
}

.rare-cases summary {
  padding: 8px 2px 2px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 800;
}

.rare-cases > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 7px;
}

.rare-cases button {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 0 4px;
  align-items: center;
  min-height: 48px;
  padding: 5px 7px;
  border-radius: 12px;
  color: var(--pink-dark);
  background: var(--pink-light);
  text-align: left;
}

.rare-cases button span {
  grid-row: span 2;
  font-size: 1.1rem;
}

.rare-cases button strong,
.rare-cases button small {
  display: block;
}

.rare-cases button strong {
  font-family: var(--round-font);
  font-size: 0.61rem;
}

.rare-cases button small {
  font-size: 0.5rem;
  font-weight: 700;
  line-height: 1.15;
}

.points-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.points-grid button {
  min-height: 52px;
  padding: 5px 2px;
  border-radius: 15px;
  color: var(--green-deep);
  background: linear-gradient(145deg, #cae979, #add35e);
  box-shadow: inset 0 -3px 0 rgba(84, 117, 29, 0.16), 0 4px 9px rgba(74, 98, 32, 0.08);
  font-family: var(--round-font);
  font-size: clamp(0.96rem, 4.5vw, 1.22rem);
  transition: filter 120ms ease, transform 120ms ease;
}

.points-grid button:hover {
  filter: brightness(1.04);
}

.points-grid button.point-pop {
  animation: point-pop 240ms ease;
}

@keyframes point-pop {
  50% { transform: scale(1.08); }
}

.pig-out-button {
  width: 100%;
  margin-top: 10px;
  padding: 9px;
  border: 1px dashed rgba(216, 74, 103, 0.38);
  border-radius: 14px;
  color: #9b3450;
  background: #ffe4ea;
  font-size: 0.74rem;
  font-weight: 850;
}

.pig-out-button span {
  margin-right: 5px;
}

.game-actions {
  display: grid;
  grid-template-columns: minmax(100px, 0.9fr) minmax(180px, 1.65fr);
  gap: 10px;
  margin-top: 11px;
}

.secondary-button,
.primary-button {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 8px 11px;
  border-radius: 21px;
  box-shadow: var(--shadow-soft);
  text-align: left;
}

.secondary-button {
  background: var(--cream);
}

.primary-button {
  color: var(--green-deep);
  background: linear-gradient(145deg, #cdea7c, #b1d65f);
  box-shadow: inset 0 -3px 0 rgba(76, 106, 29, 0.13), var(--shadow-soft);
}

.secondary-button:disabled,
.primary-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.4);
  opacity: 0.48;
}

.secondary-button svg,
.primary-button svg {
  flex: 0 0 auto;
}

.secondary-button strong,
.secondary-button small,
.primary-button strong,
.primary-button small {
  display: block;
}

.secondary-button strong,
.primary-button strong {
  font-family: var(--round-font);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.secondary-button small,
.primary-button small {
  margin-top: 2px;
  font-size: 0.6rem;
  font-weight: 650;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 21px;
}

.section-heading h1 {
  margin: 1px 0 0;
  color: var(--green-deep);
  font-family: var(--round-font);
  font-size: 2rem;
  letter-spacing: -0.035em;
}

.heading-icon,
.round-add-button {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 17px;
  color: var(--green);
  background: rgba(255, 248, 237, 0.7);
}

.settings-card {
  margin-bottom: 14px;
  padding: 17px;
  border: 1px solid rgba(56, 84, 59, 0.1);
  border-radius: 25px;
  background: rgba(255, 248, 237, 0.9);
  box-shadow: var(--shadow-soft);
}

.settings-card-heading {
  display: flex;
  gap: 11px;
  align-items: center;
  margin-bottom: 16px;
}

.settings-card-icon {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  background: var(--pink-light);
  font-size: 1.25rem;
}

.settings-card-heading h2,
.settings-card-heading p {
  margin: 0;
}

.settings-card-heading h2 {
  font-family: var(--round-font);
  font-size: 0.9rem;
}

.settings-card-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 700;
}

.settings-fieldset {
  margin: 13px 0 0;
  padding: 0;
  border: 0;
}

.settings-fieldset legend {
  margin-bottom: 7px;
  font-size: 0.66rem;
  font-weight: 850;
}

.settings-segments {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.settings-segments-three {
  grid-template-columns: repeat(3, 1fr);
}

.settings-segments label {
  cursor: pointer;
}

.settings-segments input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-segments span {
  display: grid;
  min-height: 41px;
  padding: 6px;
  place-items: center;
  border: 1px solid rgba(56, 84, 59, 0.13);
  border-radius: 12px;
  background: #fff;
  font-family: var(--round-font);
  font-size: 0.64rem;
  text-align: center;
}

.settings-segments input:checked + span {
  border-color: var(--green);
  color: var(--green-deep);
  background: var(--lime-bright);
  box-shadow: inset 0 0 0 1px var(--green);
}

.rules-guide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.rule-figure-card {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 5px;
  align-items: center;
  min-height: 61px;
  padding: 6px 8px;
  border-radius: 14px;
  background: #fff;
}

.rule-figure-card .pig-pose {
  width: 56px;
  height: 41px;
}

.rule-figure-card strong,
.rule-figure-card small {
  display: block;
}

.rule-figure-card strong {
  font-family: var(--round-font);
  font-size: 0.61rem;
  line-height: 1.1;
}

.rule-figure-card small {
  margin-top: 3px;
  color: var(--pink-dark);
  font-size: 0.56rem;
  font-weight: 850;
}

.special-rules {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.special-rules p {
  display: grid;
  grid-template-columns: 29px 1fr;
  gap: 0 5px;
  align-items: center;
  margin: 0;
  padding: 7px 9px;
  border-radius: 11px;
  background: var(--pink-light);
}

.special-rules p > span {
  grid-row: span 2;
}

.special-rules strong,
.special-rules small {
  display: block;
}

.special-rules strong {
  font-family: var(--round-font);
  font-size: 0.63rem;
}

.special-rules small {
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 700;
}

.data-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.data-actions button {
  display: grid;
  grid-template-columns: 31px 1fr;
  gap: 7px;
  align-items: center;
  min-height: 59px;
  padding: 8px 10px;
  border: 1px solid rgba(56, 84, 59, 0.11);
  border-radius: 14px;
  color: var(--green);
  background: #fff;
  text-align: left;
}

.data-actions svg {
  width: 25px;
  height: 25px;
}

.data-actions strong,
.data-actions small {
  display: block;
}

.data-actions strong {
  font-family: var(--round-font);
  font-size: 0.66rem;
}

.data-actions small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.52rem;
  line-height: 1.15;
}

.reset-data-button {
  width: 100%;
  margin-top: 10px;
  padding: 9px;
  border-radius: 11px;
  color: var(--pink-dark);
  background: transparent;
  font-size: 0.62rem;
  font-weight: 850;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.round-add-button {
  color: #fff;
  background: var(--green);
  font-family: var(--round-font);
  font-size: 1.9rem;
  line-height: 1;
}

.filter-row {
  display: flex;
  gap: 8px;
  margin: 0 -24px 16px;
  padding: 0 24px 3px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  padding: 10px 16px;
  border: 1px solid rgba(56, 84, 59, 0.1);
  border-radius: 999px;
  background: rgba(255, 248, 237, 0.78);
  font-size: 0.73rem;
  font-weight: 800;
}

.filter-chip.active {
  border-color: rgba(83, 117, 39, 0.24);
  background: var(--lime-bright);
}

.history-list,
.players-list {
  display: grid;
  gap: 10px;
}

.history-card {
  display: grid;
  grid-template-columns: 58px 1fr auto 22px;
  gap: 11px;
  align-items: center;
  width: 100%;
  min-height: 91px;
  padding: 13px 12px;
  border: 1px solid rgba(56, 84, 59, 0.1);
  border-radius: 23px;
  background: rgba(255, 248, 237, 0.93);
  box-shadow: var(--shadow-soft);
  text-align: left;
}

.duo-avatars {
  position: relative;
  width: 58px;
  height: 51px;
}

.duo-avatars .avatar {
  position: absolute;
  width: 42px;
  height: 42px;
  border: 3px solid var(--cream);
}

.duo-avatars .avatar:last-child {
  right: 0;
  bottom: 0;
}

.group-avatars {
  display: flex;
  align-items: center;
  width: 64px;
  min-width: 64px;
  height: 48px;
}

.group-avatars .avatar {
  width: 38px;
  height: 38px;
  margin-left: -22px;
  border: 3px solid var(--cream);
  font-size: 1.25rem;
}

.group-avatars .avatar:first-child {
  margin-left: 0;
}

.group-avatar-more {
  z-index: 2;
  display: grid;
  width: 29px;
  height: 29px;
  margin-left: -18px;
  place-items: center;
  border: 3px solid var(--cream);
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-size: 0.57rem;
  font-weight: 900;
}

.history-names {
  display: block;
  max-width: 150px;
  overflow: hidden;
  font-family: var(--round-font);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-date {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.history-score {
  font-family: var(--round-font);
  font-size: 1.12rem;
  white-space: nowrap;
}

.history-score small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--text-font);
  font-size: 0.54rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.history-score .winner-score {
  color: var(--green);
}

.history-score .loser-score {
  color: var(--pink-dark);
}

.history-card > svg {
  width: 18px;
  height: 18px;
}

.empty-state {
  padding: 34px 22px;
  border: 1px dashed rgba(56, 84, 59, 0.24);
  border-radius: 27px;
  background: rgba(255, 248, 237, 0.52);
  text-align: center;
}

.empty-state-emoji {
  display: block;
  margin-bottom: 9px;
  font-size: 2.5rem;
}

.empty-state h2 {
  margin: 0;
  font-family: var(--round-font);
  font-size: 1.1rem;
}

.empty-state p {
  margin: 6px auto 16px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.small-cta {
  padding: 10px 16px;
  border-radius: 13px;
  color: var(--cream);
  background: var(--green);
  font-family: var(--round-font);
  font-size: 0.72rem;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-bottom: 18px;
}

.overview-card {
  min-width: 0;
  padding: 15px 7px;
  border-radius: 21px;
  background: rgba(255, 248, 237, 0.9);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.overview-card strong,
.overview-card span {
  display: block;
}

.overview-card strong {
  color: var(--green-deep);
  font-family: var(--round-font);
  font-size: 1.65rem;
}

.overview-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stats-section {
  margin-top: 17px;
  padding: 17px;
  border-radius: 25px;
  background: rgba(255, 248, 237, 0.88);
  box-shadow: var(--shadow-soft);
}

.stats-section h2 {
  margin: 0 0 15px;
  font-family: var(--round-font);
  font-size: 1rem;
}

.ranking-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.ranking-row:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.ranking-row .avatar {
  width: 40px;
  height: 40px;
}

.ranking-name {
  display: block;
  font-family: var(--round-font);
  font-size: 0.78rem;
}

.ranking-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
}

.streak-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #9c4a12;
  background: #ffedbd;
  font-size: 0.58rem;
}

.recent-form {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-top: 6px;
}

.recent-form i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.recent-form i.win {
  background: var(--lime);
}

.recent-form small {
  margin-left: 3px;
  color: var(--muted);
  font-size: 0.57rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ranking-rate {
  color: var(--green);
  font-family: var(--round-font);
}

.bar-track {
  height: 10px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #f2e7dc;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), var(--lime));
}

.players-onboarding {
  padding: 27px 22px 23px;
  border: 1px solid rgba(56, 84, 59, 0.12);
  border-radius: 28px;
  background:
    radial-gradient(circle at 85% 12%, rgba(243, 166, 184, 0.25), transparent 115px),
    rgba(255, 248, 237, 0.94);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.onboarding-pigs {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 74px;
  margin-bottom: 10px;
}

.onboarding-pigs span {
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  border: 4px solid var(--cream);
  border-radius: 50%;
  background: var(--lime);
  box-shadow: var(--shadow-soft);
  font-size: 2rem;
}

.onboarding-pigs span + span {
  margin-left: -16px;
  background: var(--pink-light);
}

.onboarding-pigs .waiting-pig {
  color: var(--pink-dark);
  font-family: var(--round-font);
  font-size: 1.55rem;
}

.players-onboarding h2 {
  margin: 3px 0 7px;
  font-family: var(--round-font);
  font-size: 1.28rem;
}

.players-onboarding > p:not(.eyebrow) {
  max-width: 330px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.5;
}

.onboarding-progress {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  width: 112px;
  margin: 17px auto 13px;
}

.onboarding-progress span {
  height: 7px;
  border-radius: 99px;
  background: #eadfd7;
}

.onboarding-progress span.complete {
  background: var(--lime);
}

.onboarding-add-player {
  margin-top: 0;
}

.player-card {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 13px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(56, 84, 59, 0.1);
  border-radius: 23px;
  background: rgba(255, 248, 237, 0.92);
  box-shadow: var(--shadow-soft);
}

.player-card-actions {
  display: flex;
  gap: 6px;
}

.edit-player,
.delete-player {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 13px;
}

.edit-player {
  color: var(--green);
  background: #edf3da;
}

.player-card .avatar {
  width: 56px;
  height: 56px;
}

.player-card h2 {
  margin: 0;
  font-family: var(--round-font);
  font-size: 1rem;
}

.player-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.delete-player {
  color: var(--pink-dark);
  background: var(--pink-light);
}

.edit-player svg,
.delete-player svg {
  width: 18px;
  height: 18px;
}

.duel-stats-list {
  display: grid;
  gap: 10px;
}

.duel-stat-card {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.duel-stat-card:first-child {
  padding-top: 0;
  border-top: 0;
}

.duel-stat-card .duo-avatars {
  transform: scale(0.9);
  transform-origin: left center;
}

.duel-stat-names,
.duel-stat-meta {
  display: block;
}

.duel-trend {
  display: block;
  margin-top: 4px;
  color: var(--pink-dark);
  font-size: 0.59rem;
  font-weight: 800;
}

.duel-stat-names {
  font-family: var(--round-font);
  font-size: 0.76rem;
}

.duel-stat-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
}

.duel-stat-score {
  color: var(--green-deep);
  font-family: var(--round-font);
  font-size: 1.25rem;
  white-space: nowrap;
}

.stats-empty-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.45;
}

.result-correct {
  width: 100%;
  margin-top: 8px;
  color: var(--pink-dark);
  background: var(--pink-light);
}

.detail-correct,
.detail-delete {
  width: 100%;
  margin-top: 8px;
}

.detail-correct {
  color: var(--green-deep);
  background: #edf3da;
}

.detail-delete {
  color: var(--pink-dark);
  background: var(--pink-light);
}

.result-history {
  width: 100%;
  margin-top: 9px;
  color: var(--green-deep);
  background: #edf3da;
}

.result-rematch,
.detail-rematch {
  letter-spacing: 0.01em;
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--avatar-color, var(--lime));
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.08);
  font-size: 1.55rem;
  line-height: 1;
}

.modal {
  width: calc(100% - 24px);
  max-width: 510px;
  max-height: calc(100dvh - 30px);
  margin: auto auto 0;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 31px 31px 0 0;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 -15px 50px rgba(55, 30, 35, 0.2);
}

.modal[open] {
  animation: modal-in 230ms ease both;
}

.modal::backdrop {
  background: rgba(35, 60, 40, 0.4);
  backdrop-filter: blur(4px);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal form,
.result-content,
.detail-content {
  padding: 12px 22px max(26px, env(safe-area-inset-bottom));
}

.modal-handle {
  width: 43px;
  height: 5px;
  margin: 0 auto 18px;
  border-radius: 99px;
  background: #ded2cb;
}

.modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 19px;
}

.modal h2 {
  margin: 1px 0 0;
  font-family: var(--round-font);
  font-size: 1.5rem;
}

.modal-close {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 13px;
  background: #f2e8df;
  font-family: Arial, sans-serif;
  font-size: 1.55rem;
}

.modal label,
.modal legend {
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.modal select,
.modal input[type="text"] {
  width: 100%;
  height: 52px;
  margin-top: 7px;
  padding: 0 14px;
  border: 1px solid rgba(56, 84, 59, 0.15);
  border-radius: 15px;
  background: #fff;
  font-size: 16px !important;
  font-weight: 750;
  line-height: 1.25;
}

.modal fieldset {
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}

.modal .game-player-picker {
  margin-top: 0;
}

.game-player-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.game-player-option {
  min-width: 0;
  cursor: pointer;
}

.game-player-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.game-player-option-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 24px;
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 8px;
  border: 1px solid rgba(56, 84, 59, 0.13);
  border-radius: 16px;
  background: #fff;
  transition: border-color 160ms ease, background 160ms ease;
}

.game-player-option-card .avatar {
  width: 38px;
  height: 38px;
  font-size: 1.2rem;
}

.game-player-option-card strong,
.game-player-option-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-player-option-card strong {
  font-family: var(--round-font);
  font-size: 0.7rem;
}

.game-player-option-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.54rem;
}

.game-player-option-card b {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: var(--green);
  background: var(--pink-light);
  font-family: var(--round-font);
  font-size: 0.65rem;
}

.game-player-option input:checked + .game-player-option-card {
  border-color: var(--green);
  background: #eef5d7;
  box-shadow: inset 0 0 0 1px var(--green);
}

.game-player-option input:checked + .game-player-option-card b {
  color: #fff;
  background: var(--green);
}

.game-player-option input:disabled + .game-player-option-card {
  opacity: 0.48;
  cursor: not-allowed;
}

.selected-player-count {
  margin: 9px 2px 0;
  color: var(--green);
  font-size: 0.65rem;
  font-weight: 850;
}

.versus-divider {
  display: flex;
  align-items: center;
  margin: 11px 0;
  color: var(--pink-dark);
  font-family: var(--round-font);
  font-size: 0.67rem;
}

.versus-divider::before,
.versus-divider::after {
  flex: 1;
  height: 1px;
  background: var(--line);
  content: "";
}

.versus-divider span {
  display: grid;
  width: 37px;
  height: 37px;
  margin: 0 12px;
  place-items: center;
  border-radius: 50%;
  background: var(--pink-light);
}

.target-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 8px;
}

.score-mode-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 8px;
}

.score-mode-options label {
  cursor: pointer;
}

.score-mode-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.score-mode-options span {
  display: grid;
  grid-template-columns: 38px 1fr;
  min-height: 66px;
  padding: 8px;
  border: 1px solid rgba(56, 84, 59, 0.13);
  border-radius: 15px;
  background: #fff;
}

.score-mode-options b {
  display: grid;
  grid-row: span 2;
  width: 34px;
  height: 34px;
  place-items: center;
  align-self: center;
  border-radius: 11px;
  color: var(--green);
  background: var(--pink-light);
  font-family: var(--round-font);
  font-size: 0.8rem;
}

.score-mode-options strong,
.score-mode-options small {
  display: block;
  align-self: end;
}

.score-mode-options strong {
  font-family: var(--round-font);
  font-size: 0.63rem;
}

.score-mode-options small {
  align-self: start;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.54rem;
}

.score-mode-options input:checked + span {
  border-color: var(--green);
  background: #eef5d7;
  box-shadow: inset 0 0 0 1px var(--green);
}

.score-mode-options input:checked + span b {
  color: #fff;
  background: var(--green);
}

.target-options label {
  cursor: pointer;
}

.target-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.target-options span {
  display: grid;
  height: 49px;
  place-items: center;
  border: 1px solid rgba(56, 84, 59, 0.13);
  border-radius: 14px;
  background: #fff;
  font-family: var(--round-font);
  font-size: 1rem;
}

.target-options input:checked + span {
  border-color: var(--green);
  color: var(--green-deep);
  background: var(--lime-bright);
  box-shadow: inset 0 0 0 1px var(--green);
}

.color-options {
  display: flex;
  gap: 9px;
  margin-top: 10px;
}

.color-option {
  display: block;
  width: 38px;
  height: 38px;
  border: 3px solid var(--paper);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px rgba(56, 84, 59, 0.12);
}

.color-option.selected {
  box-shadow: 0 0 0 3px var(--green);
}

.form-error {
  min-height: 17px;
  margin: 9px 0 0;
  color: var(--pink-dark);
  font-size: 0.7rem;
  font-weight: 800;
}

.modal-submit {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 55px;
  margin-top: 5px;
  border-radius: 17px;
  color: var(--green-deep);
  background: linear-gradient(145deg, #cce97c, #b2d85e);
  box-shadow: inset 0 -3px 0 rgba(83, 112, 34, 0.15);
  font-family: var(--round-font);
  font-size: 0.81rem;
  text-transform: uppercase;
}

.modal-submit[hidden],
.inline-confirm[hidden],
.danger-zone-default[hidden],
.danger-confirm[hidden] {
  display: none;
}

.modal-submit svg {
  width: 20px;
  height: 20px;
}

.game-options-summary {
  margin: -2px 0 18px;
  padding: 11px 14px;
  border-radius: 16px;
  color: var(--green-deep);
  background: rgba(184, 217, 106, 0.22);
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
}

.field-helper {
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.35;
}

.target-options input:disabled + span {
  color: rgba(23, 33, 25, 0.34);
  background: rgba(255, 255, 255, 0.42);
  box-shadow: none;
  cursor: not-allowed;
}

.danger-zone {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(216, 74, 103, 0.22);
  border-radius: 19px;
  background: rgba(216, 74, 103, 0.07);
}

.danger-zone-default {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.inline-confirm {
  margin: 5px 0 10px;
  padding: 14px;
  border: 1px solid rgba(244, 198, 108, 0.7);
  border-radius: 18px;
  color: var(--green-deep);
  background: rgba(255, 239, 196, 0.72);
}

.inline-confirm strong {
  font-family: var(--round-font);
  font-size: 0.82rem;
}

.inline-confirm p {
  margin: 5px 0 11px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.4;
}

.inline-confirm > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.inline-confirm button {
  min-height: 40px;
  padding: 8px;
  border: 1px solid rgba(56, 84, 59, 0.18);
  border-radius: 12px;
  color: var(--green-deep);
  background: rgba(255, 255, 255, 0.75);
  font-size: 0.66rem;
  font-weight: 850;
}

.inline-confirm button.confirm {
  color: #fff;
  background: var(--green);
}

.danger-zone strong,
.danger-zone small {
  display: block;
}

.danger-zone strong {
  color: var(--pink-dark);
  font-family: var(--round-font);
  font-size: 0.78rem;
}

.danger-zone small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.35;
}

.danger-button {
  padding: 10px 12px;
  border: 1px solid rgba(216, 74, 103, 0.3);
  border-radius: 13px;
  color: #fff;
  background: var(--pink-dark);
  font-size: 0.68rem;
  font-weight: 850;
}

.danger-confirm p {
  margin: 5px 0 11px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.danger-confirm > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.danger-confirm button {
  min-height: 40px;
  padding: 8px;
  border: 1px solid rgba(216, 74, 103, 0.25);
  border-radius: 12px;
  color: var(--pink-dark);
  background: rgba(255, 255, 255, 0.82);
  font-size: 0.66rem;
  font-weight: 850;
}

.danger-confirm button.confirm {
  color: #fff;
  background: var(--pink-dark);
}

.result-content,
.detail-content {
  text-align: center;
}

.result-pigs {
  margin: 10px 0 4px;
  font-size: 3.4rem;
}

.result-content h2,
.detail-content h2 {
  margin: 0;
  font-size: 1.7rem;
}

.result-content > p,
.detail-content > p {
  margin: 7px 0 20px;
  color: var(--muted);
  font-size: 0.82rem;
}

.result-score {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
  font-family: var(--round-font);
  font-size: 2.1rem;
}

.result-score .winner-score {
  color: var(--green);
}

.result-score .loser-score {
  color: var(--pink-dark);
}

.standings-list {
  display: grid;
  gap: 6px;
  margin: 18px 0;
  text-align: left;
}

.standing-row {
  display: grid;
  grid-template-columns: 25px 38px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 52px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.standing-row.winner {
  border-color: rgba(83, 117, 39, 0.25);
  background: #eef5d7;
}

.standing-row.eliminated:not(.winner) {
  opacity: 0.58;
}

.standing-row .avatar {
  width: 38px;
  height: 38px;
  font-size: 1.2rem;
}

.standing-rank {
  color: var(--muted);
  font-family: var(--round-font);
  font-size: 0.74rem;
  text-align: center;
}

.standing-player,
.standing-player strong,
.standing-player small {
  display: block;
  min-width: 0;
}

.standing-player strong {
  overflow: hidden;
  font-family: var(--round-font);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standing-player small {
  margin-top: 2px;
  color: var(--pink-dark);
  font-size: 0.54rem;
  font-weight: 800;
}

.standing-score {
  color: var(--green-deep);
  font-family: var(--round-font);
  font-size: 1.2rem;
}

.detail-content h2 {
  overflow-wrap: anywhere;
}

.result-home {
  width: 100%;
  margin-top: 9px;
  color: var(--green);
  background: transparent;
}

.detail-turns {
  max-height: 230px;
  margin: 16px 0;
  overflow: auto;
  border-top: 1px solid var(--line);
  text-align: left;
}

.detail-turn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 3px;
  border-bottom: 1px solid var(--line);
  font-size: 0.73rem;
  font-weight: 750;
}

.detail-turn span:last-child {
  color: var(--green);
  font-family: var(--round-font);
}

.toast {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 22px;
  left: 20px;
  max-width: 430px;
  margin: auto;
  padding: 12px 17px;
  border-radius: 14px;
  color: #fff;
  background: var(--green-deep);
  box-shadow: var(--shadow);
  font-size: 0.77rem;
  font-weight: 750;
  text-align: center;
  transform: translateY(120px);
  transition: transform 240ms ease;
}

.toast.visible {
  transform: translateY(0);
}

@media (max-width: 390px) {
  .view {
    padding-right: 17px;
    padding-left: 17px;
  }

  .brand {
    margin-bottom: 21px;
  }

  .action-card {
    min-height: 75px;
  }

  .scoreboard {
    gap: 32px;
  }

  .turn-panel {
    padding-right: 12px;
    padding-left: 12px;
  }

  .points-grid {
    gap: 7px;
  }

  .points-grid button {
    min-height: 47px;
  }

  .history-card {
    grid-template-columns: 53px 1fr auto 17px;
    gap: 7px;
  }

  .history-names {
    max-width: 112px;
  }
}

@media (min-width: 760px) {
  body {
    padding: 24px;
  }

  .app-shell {
    min-height: calc(100dvh - 48px);
    border: 1px solid rgba(56, 84, 59, 0.1);
    border-radius: 42px;
    box-shadow: 0 28px 80px rgba(68, 38, 43, 0.2);
  }

  .bottom-nav {
    bottom: 12px;
  }

  .modal {
    margin-bottom: 24px;
    border-radius: 31px;
  }
}

@media (max-height: 760px) {
  .brand {
    margin-top: 0;
    margin-bottom: 18px;
  }

  .brand-roll {
    font-size: 4.6rem;
  }

  .brand-pigs {
    font-size: 3.1rem;
  }

  .home-note {
    display: none;
  }

  .game-header {
    margin-bottom: 6px;
  }

  .scoreboard {
    margin-bottom: 7px;
  }

  .score-card .avatar {
    width: 42px;
    height: 42px;
  }

  .score-value {
    font-size: 2.7rem;
  }

  .turn-label {
    margin-bottom: 6px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .turn-panel {
    padding-top: 13px;
    padding-bottom: 11px;
  }

  .turn-score-wrap {
    height: 55px;
  }

  .turn-score {
    font-size: 3.8rem;
  }

  .throw-count {
    margin-bottom: 9px;
  }

  .points-grid button {
    min-height: 43px;
  }

  .score-keypad button {
    min-height: 39px;
  }

  .pig-figure-button {
    min-height: 76px;
  }

  .pig-pose {
    width: 54px;
    height: 36px;
  }

  .pig-out-button {
    margin-top: 7px;
    padding: 7px;
  }

  .secondary-button,
  .primary-button {
    min-height: 56px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
