:root {
  --bg-top: #7fd5ff;
  --bg-bottom: #dff6ff;
  --card: #fff8e8;
  --text: #2f2a22;
  --muted: #5f5347;
  --primary: #e53935;
  --primary-deep: #b71c1c;
  --accent: #ffd54f;
  --pill: #fff1c4;
  --ok: #3fbf7f;
  --shadow: 0 8px 0 #7c4b22, 0 14px 28px rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Trebuchet MS', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-top) 0%, #9fe3ff 45%, var(--bg-bottom) 100%);
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 130px;
  background:
    linear-gradient(0deg, #4caf50 0 18px, transparent 18px),
    repeating-linear-gradient(
      90deg,
      #ba6d34 0 34px,
      #8f4f25 34px 36px,
      #ba6d34 36px 70px
    );
  box-shadow: inset 0 6px 0 rgba(255, 255, 255, 0.35);
  z-index: 0;
  pointer-events: none;
}

.bg-blobs .blob {
  position: fixed;
  border-radius: 18px;
  filter: none;
  opacity: 0.95;
  z-index: 0;
  animation: float 6s ease-in-out infinite;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.08);
}

.b1 {
  width: 160px;
  height: 56px;
  background: #fff;
  top: 22px;
  right: 22px;
}

.b2 {
  width: 220px;
  height: 72px;
  background: #fff;
  bottom: 180px;
  left: 24px;
  animation-delay: 1s;
}

.b3 {
  width: 140px;
  height: 52px;
  background: #fff;
  top: 34%;
  left: 70%;
  animation-delay: 2s;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 28px;
}

body.offline-mode .app {
  filter: grayscale(0.95) brightness(0.75);
  pointer-events: none;
  user-select: none;
}

.offline-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 16, 12, 0.36);
  padding: 20px;
}

.offline-card {
  width: min(92vw, 360px);
  border: 3px solid #7c4b22;
  border-radius: 14px;
  background: #fff6e6;
  box-shadow: var(--shadow);
  padding: 14px 14px 12px;
  text-align: center;
}

.offline-card h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #4a2f1b;
}

.offline-card p {
  margin: 8px 0 12px;
  font-size: 0.9rem;
  color: #5f5347;
}

.hero {
  text-align: center;
  margin-bottom: 14px;
}

.hero-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}

.lang-switch {
  justify-self: start;
}

.lang-switch select {
  border: 3px solid #7c4b22;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffe27a, #fbc02d);
  padding: 7px 28px 7px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #53311b;
  min-width: 56px;
  text-align: center;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, #7c4b22 50%),
    linear-gradient(135deg, #7c4b22 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 50%,
    calc(100% - 8px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.lang-switch select:focus {
  outline: none;
  border-color: #1e63d8;
}

.lang-switch select:active {
  transform: scale(0.99);
}

.hero h1 {
  margin: 0 auto;
  font-size: clamp(2rem, 8vw, 2.8rem);
  letter-spacing: 1px;
}

.toon-title {
  display: inline-block;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff8dc;
  transform: none;
  text-shadow:
    -2px -2px 0 #5d2c10,
    2px -2px 0 #5d2c10,
    -2px 2px 0 #5d2c10,
    2px 2px 0 #5d2c10,
    0 3px 0 #c62828,
    0 7px 12px rgba(93, 44, 16, 0.35);
  -webkit-text-stroke: 1px #5d2c10;
}

.hero p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.mini-share-btn {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  min-width: 56px;
  padding: 0 10px;
  font-size: 0.8rem;
  border-radius: 10px;
  line-height: 1.1;
}

.card {
  background: var(--card);
  border: 3px solid #7c4b22;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  animation: reveal 0.55s ease;
}

.card + .card {
  margin-top: 14px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: linear-gradient(180deg, #cb7a41, #a95e30);
  border: 3px solid #7c4b22;
  border-radius: 12px;
  padding: 6px;
  margin-bottom: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 228, 164, 0.65),
    0 4px 0 rgba(124, 75, 34, 0.35);
  gap: 4px;
}

.tab {
  border: 2px solid #8d4f24;
  border-radius: 9px;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 243, 197, 0.95), rgba(255, 243, 197, 0) 55%),
    linear-gradient(180deg, #f7b576, #de8447);
  color: #4f2c16;
  font-weight: 800;
  padding: 10px 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 247, 220, 0.92),
    0 3px 0 rgba(124, 75, 34, 0.25);
  transition: transform 0.14s ease, filter 0.14s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.tab.active {
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 236, 0.98), rgba(255, 255, 236, 0) 45%),
    linear-gradient(180deg, #ffe57f, #ffc940 72%, #f2b21e);
  border-color: #6d3e1d;
  color: #2e200f;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 241, 0.96),
    0 3px 0 rgba(124, 75, 34, 0.3),
    0 0 10px rgba(255, 196, 61, 0.42);
  transform: translateY(-1px);
}

.panel {
  display: grid;
  gap: 8px;
}

label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}

input,
select,
button {
  font: inherit;
}

input,
.rule-item {
  width: 100%;
  border: 3px solid #7c4b22;
  border-radius: 10px;
  padding: 11px 12px;
  background: #fffdf6;
}

input:focus {
  border-color: #1e63d8;
  outline: none;
}

.rule-list {
  display: grid;
  gap: 8px;
}

.rule-item {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 9px;
  cursor: pointer;
  text-align: left;
  position: relative;
  overflow: hidden;
  padding: 11px 12px;
  border-width: 3px;
  border-color: #8b6a4a;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 248, 236, 0.66), rgba(255, 248, 236, 0) 42%),
    linear-gradient(180deg, #fffaf0 0%, #f6ebd8 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 4px 0 rgba(112, 84, 56, 0.2);
  transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.rule-item > * {
  position: relative;
  z-index: 1;
}

.rule-item::before {
  content: none;
}

.rule-item::after {
  content: none;
}

.rule-item:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 6px 0 rgba(112, 84, 56, 0.22);
}

.rule-item.active {
  border-color: #845d35;
  background:
    radial-gradient(circle at 14% 16%, rgba(255, 246, 224, 0.85), rgba(255, 246, 224, 0) 52%),
    linear-gradient(180deg, #ffe4a8 0%, #e8b869 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 247, 231, 0.9),
    0 0 0 2px rgba(132, 93, 53, 0.2),
    0 6px 0 rgba(112, 84, 56, 0.26);
  transform: translateY(-2px);
  animation: ruleSingleBorderPulse 2.6s ease-in-out infinite;
}

.rule-item h4 {
  margin: 0;
  font-size: 0.97rem;
  color: #3f2716;
  letter-spacing: 0.2px;
}

.rule-content {
  width: 100%;
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: stretch;
  column-gap: 11px;
}

.rule-copy {
  min-width: 0;
}

.rule-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 100%;
  min-height: 38px;
  line-height: 1;
  font-size: 1.68rem;
}

.rule-item p {
  margin: 3px 0 0;
  color: #6b5a4a;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.primary,
.ghost {
  border: 3px solid #7c4b22;
  border-radius: 10px;
  padding: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
}

.primary {
  background: linear-gradient(180deg, #ff6b66, #d93025);
  color: #fff;
}

.ghost {
  background: linear-gradient(180deg, #ffe27a, #fbc02d);
  color: #53311b;
}

.primary:active,
.ghost:active,
.tab:active {
  transform: scale(0.99);
}

.status {
  margin: 12px 2px 2px;
  font-size: 0.88rem;
  color: var(--muted);
}

.icp-footer {
  margin: 10px 0 4px;
  text-align: center;
  font-size: 0.76rem;
  line-height: 1.35;
  color: rgba(47, 42, 34, 0.78);
}

.icp-footer a {
  color: rgba(47, 42, 34, 0.78);
  text-decoration: none;
  border-bottom: 1px solid rgba(47, 42, 34, 0.3);
}

.icp-footer a:active,
.icp-footer a:hover {
  color: rgba(47, 42, 34, 0.95);
  border-bottom-color: rgba(47, 42, 34, 0.55);
}

.room-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.room-head > div:first-child {
  flex: 1;
  min-width: 0;
}

.room-tools {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  gap: 8px;
}

.mini-btn {
  padding: 8px 10px;
  font-size: 0.78rem;
  border-radius: 999px;
}

.room-head h2 {
  margin: 0;
}

.room-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.pill {
  background: var(--pill);
  color: #7c4b22;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 2px solid #7c4b22;
}

.prompt-box {
  margin: 14px 0 10px;
  border-radius: 14px;
  border: 3px solid #7c4b22;
  background: linear-gradient(135deg, #ffffff, #f5fbff);
  padding: 14px;
}

.prompt-label {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.prompt-text {
  margin: 6px 0 0;
  font-size: 1.04rem;
  line-height: 1.45;
  font-weight: 700;
}

.card-display {
  margin-top: 12px;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.poker-card {
  width: 126px;
  height: 176px;
  border-radius: 14px;
  border: 3px solid #7c4b22;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 214, 79, 0.14) 0%, rgba(255, 214, 79, 0) 46%),
    linear-gradient(160deg, #ffffff 0%, #fff9ef 68%, #f7e7c7 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -8px 12px rgba(0, 0, 0, 0.06),
    0 8px 0 rgba(124, 75, 34, 0.25),
    0 12px 24px rgba(0, 0, 0, 0.15);
  padding: 10px 12px;
  display: grid;
  align-content: space-between;
  position: relative;
  overflow: visible;
}

.poker-card::before {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 10px;
  border: 1px dashed rgba(124, 75, 34, 0.15);
  pointer-events: none;
}

.tenhalf-countdown-overlay {
  position: absolute;
  top: -8px;
  right: -10px;
  z-index: 6;
  min-width: 58px;
  text-align: center;
  color: #fff;
  background: linear-gradient(120deg, #ff7a00, #ff3d00);
  border: 2px solid #7c2d12;
  border-radius: 999px;
  font-size: 1.02rem;
  font-weight: 900;
  line-height: 1;
  padding: 6px 11px;
  box-shadow:
    0 2px 0 rgba(124, 45, 18, 0.35),
    0 0 8px rgba(255, 90, 0, 0.35);
  animation: countdownPulse 0.9s ease-in-out infinite;
}

.tenhalf-countdown-overlay.danger {
  background: linear-gradient(120deg, #ff2f2f, #c51717);
  border-color: #5f0f0f;
  box-shadow:
    0 2px 0 rgba(95, 15, 15, 0.35),
    0 0 10px rgba(255, 60, 60, 0.6);
}

.poker-card.tenhalf-poker {
  width: 101px;
  height: 141px;
  padding: 8px 10px;
  transform: rotate(-1.8deg);
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 214, 79, 0.18) 0%, rgba(255, 214, 79, 0) 44%),
    linear-gradient(160deg, #fffefb 0%, #fff5de 60%, #ffe6ba 100%);
}

.poker-card.zjh-pending {
  background:
    repeating-linear-gradient(
      -45deg,
      #fff7e8 0px,
      #fff7e8 10px,
      #ffe9c8 10px,
      #ffe9c8 20px
    );
}

.card-display.tenhalf-display {
  margin-top: 16px;
  gap: 10px;
}

.card-display.zjh-openable-display {
  cursor: pointer;
}

.card-display.zjh-openable-display .poker-card {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -8px 12px rgba(0, 0, 0, 0.06),
    0 8px 0 rgba(124, 75, 34, 0.25),
    0 12px 24px rgba(0, 0, 0, 0.15),
    0 0 0 4px rgba(255, 213, 79, 0.45);
}

.card-display.tenhalf-display .card-suit {
  font-size: 2.7rem;
}

.card-display.tenhalf-display .card-rank-top,
.card-display.tenhalf-display .card-rank-bottom {
  font-size: 1.02rem;
}

.card-rank-top,
.card-rank-bottom {
  font-size: 1.24rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  z-index: 1;
}

.card-rank-bottom {
  justify-self: end;
  transform: rotate(180deg);
}

.card-suit {
  justify-self: center;
  font-size: 3.4rem;
  line-height: 1;
  z-index: 1;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.85),
    0 6px 12px rgba(0, 0, 0, 0.14);
}

.red-suit {
  color: #e74b63;
}

.card-meta {
  margin: 0;
  font-size: 0.86rem;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

.card-display.tenhalf-display .card-meta {
  color: #7c4b22;
  background: rgba(255, 230, 188, 0.72);
  border: 2px solid rgba(124, 75, 34, 0.35);
  border-radius: 999px;
  padding: 4px 10px;
}

.tenhalf-table {
  margin-top: 12px;
  border: 3px solid #7c4b22;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 214, 79, 0.16), transparent 36%),
    linear-gradient(180deg, #fff6dc, #fff0c9);
  padding: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 4px 0 rgba(124, 75, 34, 0.16);
}

.tenhalf-table-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.tenhalf-table-row.single-col {
  grid-template-columns: 1fr;
}

.tenhalf-table-card-wrap {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.tenhalf-table-label {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 800;
  color: #7c4b22;
}

.tenhalf-table-card {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

#tenhalf-base-card {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}

#tenhalf-base-card .tenhalf-mini-card {
  flex: 0 0 auto;
}

#tenhalf-base-card.busted .tenhalf-mini-card {
  filter: grayscale(0.55) brightness(0.9);
  opacity: 0.82;
}

#tenhalf-base-card::-webkit-scrollbar {
  height: 6px;
}

#tenhalf-base-card::-webkit-scrollbar-thumb {
  background: rgba(124, 75, 34, 0.4);
  border-radius: 999px;
}

.tenhalf-table-bids {
  margin-top: 6px;
  display: grid;
  gap: 4px;
}

.zjh-open-wrap {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.zjh-open-btn {
  width: auto;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
}

.tenhalf-bid-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.tenhalf-bid-row-wrap {
  position: relative;
  padding-top: 16px;
}

.tenhalf-bid-pointer {
  position: absolute;
  left: 6px;
  top: -4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #7a2f15;
  font-weight: 900;
  font-size: 0.78rem;
  pointer-events: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
  animation: fingerHintFloat 0.9s ease-in-out infinite;
}

.tenhalf-bid-pointer .finger {
  width: 20px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: rotate(180deg);
  animation: fingerTap 0.65s ease-in-out infinite;
}

.tenhalf-bid-pointer .finger-svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.8)) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2));
}

.tenhalf-bid-pointer .text {
  background: rgba(255, 234, 174, 0.95);
  border: 2px solid #7c4b22;
  border-radius: 999px;
  padding: 2px 7px;
}

.tenhalf-bid-row.busted {
  opacity: 0.45;
  filter: grayscale(0.35);
}

.tenhalf-bid-tip {
  margin: 0;
  font-size: 0.76rem;
  color: #7c4b22;
  font-weight: 700;
}

.tenhalf-bid-tip.busted {
  color: #b42318;
  font-weight: 800;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

#camera-shot {
  background: linear-gradient(180deg, #6fb9ff, #2f86df);
  border-color: #1f5f9f;
  color: #fff;
}

#nose-touch {
  background: linear-gradient(180deg, #72d998, #2ea55f);
  border-color: #1f6f40;
  color: #fff;
}

#tenhalf-actions {
  grid-template-columns: 1fr;
}

#tenhalf-hit {
  min-height: 54px;
  font-size: 1rem;
  letter-spacing: 0.5px;
  box-shadow:
    0 4px 0 rgba(0, 0, 0, 0.2),
    0 0 0 2px rgba(255, 255, 255, 0.3) inset;
}

#tenhalf-hit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.15);
}

.player-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 8px;
}

.player-list li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  border: 3px solid #7c4b22;
  background: #fff7de;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.92rem;
}

.player-list li.tenhalf-current {
  border-color: #d93025;
  box-shadow:
    0 0 0 2px rgba(255, 214, 79, 0.55) inset,
    0 0 0 2px rgba(217, 48, 37, 0.2),
    0 4px 0 rgba(124, 75, 34, 0.18),
    0 0 16px rgba(217, 48, 37, 0.18);
}

.player-list li.tenhalf-busted {
  background: linear-gradient(180deg, #fff1f1, #ffe3e3);
}

.player-list li.tenhalf-finished {
  background: linear-gradient(180deg, #fffdf4, #fff6dc);
}

.player-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}

.player-left-wrap {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.tenhalf-line {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.tenhalf-hand {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tenhalf-meta {
  display: grid;
  gap: 4px;
  align-items: start;
}

.tenhalf-mini-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 36px;
  padding: 0 4px;
  border-radius: 8px;
  border: 2px solid #7c4b22;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 28%),
    linear-gradient(180deg, #fffef9, #efe1bd);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 2px 0 rgba(0, 0, 0, 0.12);
  font-size: 0.74rem;
  font-weight: 900;
  color: #3a2a18;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
}

.tenhalf-mini-card.red {
  color: #d93025;
}

.tenhalf-mini-card.empty {
  color: #9b8a72;
  background: #f5e9c9;
}

.tenhalf-mini-card.back {
  color: rgba(255, 255, 255, 0.92);
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 255, 255, 0.2), transparent 28%),
    linear-gradient(180deg, #7b4cff, #3b1f86);
  border-color: #2c145f;
}

.tenhalf-mini-card.back span {
  font-size: 0.72rem;
  letter-spacing: 1px;
}

.tenhalf-formula-row {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  color: #4a4a4a;
  font-size: 0.73rem;
  line-height: 1.2;
  min-height: 24px;
}

.tenhalf-formula-row.busted {
  opacity: 0.72;
}

.tenhalf-formula-row .tenhalf-mini-card {
  min-width: 20px;
  height: 27px;
  padding: 0 3px;
  font-size: 0.64rem;
}

.tenhalf-cup-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 19px;
}

.tenhalf-cup-mini .tenhalf-cup-graphic {
  width: 11px;
  height: 15px;
}

.tenhalf-cup-mini .tenhalf-cup-graphic::before {
  top: -6px;
  height: 6px;
}

.tenhalf-op {
  color: #8a8a8a;
  font-size: 0.72rem;
  font-weight: 700;
  margin: 0 1px;
}

.tenhalf-formula-text {
  color: #505050;
  font-size: 0.72rem;
  font-weight: 700;
  padding-left: 1px;
}

.tenhalf-bust {
  color: #6a4242;
  background: #f5f2f2;
  border: 1px solid #d9caca;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 7px;
}

.tenhalf-bid-wrap {
  display: grid;
  gap: 4px;
  width: 100%;
}

.tenhalf-cup-meter {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  flex-wrap: wrap;
}

.tenhalf-cup-meter.readonly {
  opacity: 0.95;
}

.tenhalf-cup-btn,
.tenhalf-cup-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 28px;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  position: relative;
  overflow: visible;
}

.tenhalf-cup-btn {
  cursor: pointer;
}

.tenhalf-cup-btn.active,
.tenhalf-cup-icon.active {
  background: transparent;
  color: inherit;
  border-color: transparent;
  box-shadow: none;
  transform: translateY(-1px);
  filter: drop-shadow(0 0 5px rgba(255, 183, 0, 0.8)) drop-shadow(0 0 8px rgba(255, 138, 0, 0.55));
}

.tenhalf-cup-btn:active {
  transform: translateY(1px);
}

.tenhalf-cup-graphic {
  width: 13px;
  height: 18px;
  border-radius: 4px 4px 6px 6px;
  border: 2px solid #8c5c1a;
  background:
    linear-gradient(180deg, #fffdf6 0%, #f8efcf 24%, #f2c85f 25%, #df9f2e 100%);
  position: relative;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -3px 0 rgba(140, 92, 26, 0.14);
}

.tenhalf-cup-graphic::before {
  content: '';
  position: absolute;
  left: -2px;
  right: -2px;
  top: -7px;
  height: 10px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 20% 55%, rgba(255, 255, 255, 0.95) 0 35%, transparent 36%),
    radial-gradient(circle at 45% 45%, rgba(255, 255, 255, 0.95) 0 32%, transparent 33%),
    radial-gradient(circle at 72% 58%, rgba(255, 255, 255, 0.95) 0 34%, transparent 35%),
    linear-gradient(180deg, #fffefb, #f4ead1);
  border: 1px solid rgba(195, 173, 125, 0.9);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

.tenhalf-cup-graphic::after {
  content: none;
}

.tenhalf-cup-btn.active .tenhalf-cup-graphic,
.tenhalf-cup-icon.active .tenhalf-cup-graphic {
  border-color: #7a4a10;
  background:
    linear-gradient(180deg, #fffdf8 0%, #f8efcd 22%, #ffd25f 23%, #f2a81b 70%, #d38708 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 0 0 1px rgba(255, 238, 161, 0.55),
    0 0 8px rgba(255, 179, 43, 0.65);
}

.tenhalf-cup-btn.active .tenhalf-cup-graphic::before,
.tenhalf-cup-icon.active .tenhalf-cup-graphic::before {
  border-color: rgba(182, 154, 98, 0.95);
  background:
    radial-gradient(circle at 20% 55%, rgba(255, 255, 255, 1) 0 35%, transparent 36%),
    radial-gradient(circle at 45% 45%, rgba(255, 255, 255, 1) 0 32%, transparent 33%),
    radial-gradient(circle at 72% 58%, rgba(255, 255, 255, 1) 0 34%, transparent 35%),
    linear-gradient(180deg, #fffefc, #f3ead4);
}

.tenhalf-cup-btn.active .tenhalf-cup-graphic::after,
.tenhalf-cup-icon.active .tenhalf-cup-graphic::after {
  content: none;
}

.tenhalf-bid-help {
  font-size: 0.72rem;
  color: #7c4b22;
  font-weight: 700;
}

.dice-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.dice-row.covered {
  color: #b9c5d6;
}

.dice-face {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid #d4d9e2;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.98) 0 24%, rgba(255, 255, 255, 0) 25%),
    linear-gradient(145deg, #ffffff 0%, #f7f9fc 42%, #e5eaf2 78%, #d5dce7 100%);
  box-shadow:
    inset 0 2px 1px rgba(255, 255, 255, 0.98),
    inset -2px -4px 6px rgba(119, 131, 151, 0.16),
    0 6px 10px rgba(8, 18, 38, 0.16),
    0 2px 0 rgba(165, 175, 192, 0.72);
  position: relative;
  transform-style: preserve-3d;
}

.dice-face.covered {
  border-color: #8ea3be;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.32) 0 22%, rgba(255, 255, 255, 0) 23%),
    linear-gradient(145deg, #4a77b1 0%, #355f95 52%, #294a77 100%);
  box-shadow:
    inset 0 2px 1px rgba(255, 255, 255, 0.35),
    inset -3px -4px 6px rgba(14, 26, 54, 0.22),
    0 6px 10px rgba(8, 18, 38, 0.18),
    0 2px 0 rgba(36, 63, 100, 0.72);
}

.dice-inner {
  position: relative;
  width: 78%;
  height: 78%;
}

.dice-pip {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #2030cf;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 1px 2px rgba(10, 16, 96, 0.24);
}

.dice-face.red-pips .dice-pip {
  background: #de1c1c;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 1px 2px rgba(116, 10, 10, 0.24);
}

.p1 { top: 0; left: 0; }
.p2 { top: 0; left: 50%; transform: translateX(-50%); }
.p3 { top: 0; right: 0; }
.p4 { top: 50%; left: 0; transform: translateY(-50%); }
.p5 { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.p6 { top: 50%; right: 0; transform: translateY(-50%); }
.p7 { bottom: 0; left: 0; }
.p8 { bottom: 0; left: 50%; transform: translateX(-50%); }
.p9 { bottom: 0; right: 0; }

.dice-cover-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #d6e2f5;
  box-shadow:
    11px 0 0 #d6e2f5,
    -11px 0 0 #d6e2f5,
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.dice-note {
  color: #d7e1f1;
  font-size: 0.74rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(8, 14, 28, 0.35);
}

.player-seq {
  color: #4a2d18;
  background: #ffd54f;
  border-radius: 999px;
  font-size: 0.7rem;
  padding: 2px 7px;
  font-weight: 700;
  border: 2px solid #7c4b22;
}

.player-right {
  display: inline-flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.role-badge {
  color: #fff;
  background: linear-gradient(120deg, #1e63d8, #5ea7ff);
  border-radius: 999px;
  font-size: 0.7rem;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0 6px;
  font-weight: 700;
  border: 2px solid #1a4a9e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.flip-state {
  color: #5b4a30;
  background: #ffe8a6;
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 3px 8px;
  font-weight: 700;
  border: 2px solid #7c4b22;
}

.player-list .host-tag {
  color: #fff;
  background: linear-gradient(90deg, #e53935, #ff7043);
  border-radius: 999px;
  font-size: 0.73rem;
  padding: 3px 9px;
  font-weight: 700;
  border: 2px solid #7c1d1d;
}

.player-list .self-tag {
  color: #fff;
  background: linear-gradient(90deg, #4fcf7b, #1f9d4b);
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 2px 8px;
  font-weight: 700;
  border: 2px solid #1f6f38;
}

#dice-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  gap: 10px;
}

.my-dice-panel {
  position: relative;
  margin-bottom: 10px;
  border: 3px solid #7c4b22;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 18%, rgba(110, 190, 255, 0.14) 0, rgba(110, 190, 255, 0) 28%),
    linear-gradient(180deg, #17325c 0%, #122748 52%, #0d1f3a 100%);
  padding: 10px 10px 16px;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -10px 20px rgba(0, 0, 0, 0.18),
    0 10px 20px rgba(18, 26, 48, 0.2);
}

.my-dice-label {
  position: relative;
  z-index: 2;
  margin: 0 0 8px;
  font-size: 0.78rem;
  color: #f7df9f;
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.28);
}

.dice-stage {
  position: relative;
  width: 298px;
  margin: -6px auto 0;
  padding-top: 6px;
}

.dice-cup-image {
  position: relative;
  z-index: 3;
  display: block;
  width: 298px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  transform: translateX(0);
  user-select: none;
  -webkit-user-drag: none;
}

.my-dice-row {
  position: relative;
  z-index: 1;
  gap: 4px;
  align-items: flex-end;
  justify-content: center;
  perspective: 900px;
  width: 214px;
  margin: -56px auto 0;
  padding: 56px 10px 12px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 38%, rgba(92, 171, 255, 0.28) 0, rgba(92, 171, 255, 0) 48%),
    linear-gradient(180deg, #3d72b2 0%, #305d98 100%);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.16),
    inset 0 -6px 12px rgba(8, 27, 58, 0.3),
    0 10px 16px rgba(3, 12, 28, 0.24);
}

.my-dice-row::after {
  content: '';
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 8px;
  height: 10px;
  border-radius: 999px;
  background: rgba(5, 13, 29, 0.22);
  filter: blur(4px);
}

.my-dice-row .dice-face {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid #d4d9e2;
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.98) 0 26%, rgba(255, 255, 255, 0) 27%),
    linear-gradient(145deg, #ffffff 0%, #f7f9fc 42%, #e5eaf2 78%, #d4dbe6 100%);
  box-shadow:
    inset 0 2px 1px rgba(255, 255, 255, 0.98),
    inset -3px -5px 8px rgba(119, 131, 151, 0.18),
    0 10px 16px rgba(8, 18, 38, 0.22),
    0 3px 0 rgba(165, 175, 192, 0.8);
  transform-style: preserve-3d;
  transform: rotateX(18deg) rotateY(-18deg);
  overflow: visible;
}

.my-dice-row .dice-face::before,
.my-dice-row .dice-face::after {
  content: '';
  position: absolute;
  border-radius: 11px;
  pointer-events: none;
}

.my-dice-row .dice-face::before {
  inset: auto -5px -1px auto;
  width: 12px;
  height: calc(100% - 6px);
  transform: skewY(-28deg);
  transform-origin: right center;
  background: linear-gradient(180deg, #d9e0ea 0%, #bcc6d4 100%);
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.6);
}

.my-dice-row .dice-face::after {
  left: 4px;
  right: -1px;
  bottom: -6px;
  height: 12px;
  transform: skewX(-58deg);
  transform-origin: left bottom;
  background: linear-gradient(90deg, #c7d1de 0%, #aeb9c9 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.my-dice-row .dice-pip {
  width: 6px;
  height: 6px;
  background: #1d2fd8;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 1px 2px rgba(10, 16, 96, 0.28);
}

.my-dice-row .dice-face.red-pips .dice-pip {
  background: #e51717;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 1px 2px rgba(104, 8, 8, 0.28);
}

.my-dice-row .dice-inner {
  width: 76%;
  height: 76%;
  transform: translateZ(6px);
}

.my-dice-row .dice-face:nth-child(odd) {
  transform: rotateX(17deg) rotateY(-20deg) rotateZ(-2deg);
}

.my-dice-row .dice-face:nth-child(even) {
  transform: rotateX(17deg) rotateY(-14deg) rotateZ(2deg);
}

#dice-actions .ghost {
  width: 100%;
  height: 46px;
  padding: 12px 10px;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

#dice-open {
  background: linear-gradient(180deg, #7adf8f, #3aa85e);
  color: #17351f;
  border-color: #245a35;
}

#dice-split {
  background: linear-gradient(180deg, #ff8a80, #e53935);
  color: #fff;
  border-color: #8b1d1d;
}

.hidden {
  display: none !important;
}

.camera-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.86) 62%),
    linear-gradient(180deg, rgba(16, 16, 16, 0.92), rgba(10, 10, 10, 0.96));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.camera-overlay::before {
  content: '';
  position: absolute;
  inset: -20%;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08) 0 2px,
    rgba(255, 255, 255, 0) 2px 9px
  );
  opacity: 0.15;
  animation: cameraScan 1.8s linear infinite;
}

.camera-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
}

.camera-overlay.active::after {
  animation: cameraFlash 2.3s ease-in-out infinite;
}

.camera-overlay-inner {
  position: relative;
  z-index: 1;
  width: min(86vw, 360px);
  aspect-ratio: 1 / 1;
  border-radius: 26px;
  border: 4px solid #f2d69b;
  background:
    radial-gradient(circle at 50% 42%, rgba(86, 157, 219, 0.35), rgba(15, 40, 70, 0.88) 56%),
    linear-gradient(180deg, #1b293a, #0b111a);
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, 0.08),
    0 12px 40px rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: center;
}

.camera-lens {
  width: 48%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 6px solid #86b9e6;
  background:
    radial-gradient(circle at 34% 34%, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 28%),
    radial-gradient(circle at 56% 58%, rgba(20, 77, 136, 0.86), rgba(4, 18, 34, 0.98) 62%);
  box-shadow:
    inset 0 0 16px rgba(255, 255, 255, 0.16),
    0 0 24px rgba(104, 171, 224, 0.45);
  animation: lensPulse 1.1s ease-in-out infinite;
}

.camera-overlay-text {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  margin: 0;
  padding: 4px 10px;
  border-radius: 999px;
  border: 2px solid #f2d69b;
  background: rgba(12, 12, 12, 0.65);
  color: #fff4d8;
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.3px;
}

.nose-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.86) 62%),
    linear-gradient(180deg, rgba(17, 20, 26, 0.92), rgba(9, 12, 16, 0.96));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.nose-overlay-inner {
  position: relative;
  width: min(86vw, 360px);
  height: min(64vh, 460px);
  border-radius: 22px;
  border: 4px solid #f2d69b;
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 236, 196, 0.32), rgba(230, 171, 121, 0.08) 34%, transparent 64%),
    linear-gradient(180deg, #4a3025, #2b1b15);
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.08),
    0 12px 40px rgba(0, 0, 0, 0.48);
}

.nose-overlay-inner::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 45%;
  width: 64%;
  aspect-ratio: 1.05 / 1;
  transform: translate(-50%, -50%);
  border-radius: 52% 52% 48% 48%;
  background:
    radial-gradient(circle at 36% 34%, rgba(255, 247, 231, 0.85), rgba(255, 255, 255, 0) 26%),
    radial-gradient(circle at 50% 74%, rgba(198, 128, 102, 0.25), rgba(198, 128, 102, 0) 34%),
    linear-gradient(180deg, #ffd6d8, #f1a8ae);
  box-shadow:
    inset 0 -8px 16px rgba(153, 82, 89, 0.22),
    0 8px 18px rgba(0, 0, 0, 0.25);
}

.nose-overlay-inner::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 52%;
  width: 34%;
  height: 19%;
  transform: translate(-50%, -50%) rotate(0deg);
  border-radius: 48% 48% 52% 52%;
  background:
    radial-gradient(ellipse at 34% 56%, #7c3a44 0 18%, rgba(124, 58, 68, 0) 24%),
    radial-gradient(ellipse at 66% 56%, #7c3a44 0 18%, rgba(124, 58, 68, 0) 24%),
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 18%),
    linear-gradient(180deg, #ffb8c0, #f08f9c);
  box-shadow:
    inset 0 -4px 8px rgba(148, 64, 82, 0.28),
    0 0 12px rgba(255, 153, 169, 0.45);
}

.nose-hand {
  display: none;
}

.nose-hand::before {
  content: none;
}

.nose-hand::after {
  content: none;
}

.nose-overlay.active .nose-hand {
  animation: none;
}

.nose-overlay.active .nose-overlay-inner::after {
  animation: noseSwing 0.8s ease-in-out infinite;
}

.nose-overlay-text {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  margin: 0;
  padding: 4px 10px;
  border-radius: 999px;
  border: 2px solid #f2d69b;
  background: rgba(12, 12, 12, 0.65);
  color: #fff4d8;
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.3px;
}

@keyframes ruleSingleBorderPulse {
  0%,
  100% {
    border-color: rgba(132, 93, 53, 0.8);
    box-shadow:
      inset 0 0 0 1px rgba(255, 247, 231, 0.9),
      0 0 0 2px rgba(132, 93, 53, 0.22),
      0 6px 0 rgba(112, 84, 56, 0.24);
  }
  50% {
    border-color: rgba(109, 76, 44, 0.98);
    box-shadow:
      inset 0 0 0 1px rgba(255, 247, 231, 0.95),
      0 0 0 3px rgba(109, 76, 44, 0.3),
      0 7px 0 rgba(112, 84, 56, 0.28);
  }
}

@keyframes reveal {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes countdownPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@keyframes fingerHintFloat {
  0%, 100% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(-2px);
    opacity: 0.92;
  }
}

@keyframes fingerTap {
  0%, 100% {
    transform: rotate(180deg) translateY(0) scale(1);
  }
  50% {
    transform: rotate(180deg) translateY(-4px) scale(1.06);
  }
}

@keyframes cameraFlash {
  0%,
  73%,
  100% {
    opacity: 0;
  }
  76% {
    opacity: 0.65;
  }
  80% {
    opacity: 0.08;
  }
}

@keyframes cameraScan {
  0% {
    transform: translateY(-3%);
  }
  100% {
    transform: translateY(3%);
  }
}

@keyframes lensPulse {
  0%,
  100% {
    transform: scale(1);
    filter: saturate(1);
  }
  50% {
    transform: scale(1.03);
    filter: saturate(1.18);
  }
}

@keyframes noseTap {
  0%,
  100% {
    transform: translate(-50%, -50%) rotate(-14deg) scale(1);
  }
  50% {
    transform: translate(-66%, -74%) rotate(-18deg) scale(1.03);
  }
}

@keyframes noseSwing {
  0%,
  100% {
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
  }
  25% {
    transform: translate(-50%, -50%) rotate(-10deg) scale(1.05);
  }
  50% {
    transform: translate(-50%, -50%) rotate(0deg) scale(1.02);
  }
  75% {
    transform: translate(-50%, -50%) rotate(10deg) scale(1.05);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-18px);
  }
}

@keyframes title-bounce {
  0%,
  100% {
    transform: rotate(-1.5deg) translateY(0);
  }
  50% {
    transform: rotate(-1.5deg) translateY(-4px);
  }
}

@media (max-width: 430px) {
  .hero h1 {
    font-size: 2rem;
  }

  .action-row {
    grid-template-columns: 1fr;
  }

  .room-head {
    align-items: flex-start;
  }

  .room-tools {
    width: 100%;
    justify-content: flex-end;
  }
}
