/* The rule modules' parts (their phone tweaks: the end of phone.css). */

/* ------------------------------------------------------------------------ */
/* «Происшествия на Катане»: the event card instead of the dice               */
/* ------------------------------------------------------------------------ */

/* The number of a card: a cream disc like a number token; 6, 8 and 7 in red. */
.ev-num {
  display: inline-flex; flex: none; align-items: center; justify-content: center;
  width: 54px; height: 54px; border-radius: 50%;
  background: #F7EFDD; color: #22303B; box-shadow: 0 0 0 3px rgba(14, 31, 43, 0.6), 0 2px 8px rgba(0, 0, 0, 0.35);
  font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1;
}
.ev-num.is-red { color: #B3261E; }
.ev-num.is-bar { width: 42px; height: 42px; font-size: 19px; box-shadow: 0 0 0 2px rgba(14, 31, 43, 0.6); }
.ev-num.is-bar.is-empty { background: rgba(247, 239, 221, 0.1); color: var(--muted); box-shadow: inset 0 0 0 1px rgba(247, 239, 221, 0.25); }
.ev-num.is-phone { width: 30px; height: 30px; font-size: 15px; box-shadow: none; }
.ev-num.is-mini { width: 26px; height: 26px; font-size: 12px; box-shadow: none; }

/* The card face (the reveal over the board, the deck dialog). Its mood colors the frame. */
.ev-card {
  --ev: var(--accent);
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px;
  width: min(340px, 100%); padding: 18px 20px 20px; border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--ev) 55%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--ev) 16%, var(--card)) 0%, var(--card) 62%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: center;
}
.ev-mood-good { --ev: var(--ok); }
.ev-mood-bad { --ev: var(--danger); }
.ev-mood-mixed { --ev: #4C8DF0; }
.ev-mood-calm { --ev: var(--accent); }
.ev-card-top { display: flex; align-items: center; justify-content: center; gap: 14px; }
.ev-card-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 16px;
  background: color-mix(in srgb, var(--ev) 20%, transparent); color: color-mix(in srgb, var(--ev) 70%, #fff);
}
.ev-card-title { font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1.2; letter-spacing: .01em; }
.ev-card-text { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.45; }
.ev-newyear {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 600;
}
.ev-card.is-compact { width: auto; padding: 10px 14px; gap: 6px; }

/* The reveal: the opened card over the board for a few seconds (a click closes it). */
.ev-reveal {
  position: absolute; inset: 0; z-index: var(--z-reveal); display: flex; align-items: center; justify-content: center; padding: 12px;
  background: radial-gradient(closest-side, rgba(14, 31, 43, 0.55), rgba(14, 31, 43, 0));
  cursor: pointer;
}
.ev-reveal-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 360px; width: 100%; }
.ev-reveal-who { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: rgba(14, 31, 43, 0.85); color: var(--text-2); font-size: 13px; }
.ev-reveal-foot { padding: 4px 12px; border-radius: 999px; background: rgba(14, 31, 43, 0.85); color: var(--muted); font-size: 12px; }
.ev-dot { width: 9px; height: 9px; border-radius: 50%; }
.ev-reveal.is-in .ev-card { animation: evFlip .55s cubic-bezier(.2, .9, .3, 1.2) both; }
.ev-reveal.is-in .ev-reveal-who, .ev-reveal.is-in .ev-reveal-foot { animation: fadeIn .3s ease both; }
@keyframes evFlip {
  0% { opacity: 0; transform: perspective(700px) rotateY(80deg) scale(.7); }
  60% { opacity: 1; transform: perspective(700px) rotateY(-8deg) scale(1.03); }
  100% { opacity: 1; transform: none; }
}

/* Desktop action bar: the last card and the deck counter where the dice were. */
.ev-bar {
  display: inline-flex; align-items: center; gap: 10px; max-width: 250px; min-height: 48px; padding: 3px 12px 3px 4px;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--row); color: var(--text); text-align: left; cursor: pointer;
}
.ev-bar:hover { border-color: var(--accent-line); background: var(--row-hover); }
.ev-bar-text { display: flex; flex-direction: column; min-width: 0; }
.ev-bar-title { overflow: hidden; font-weight: 600; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.ev-bar-deck { overflow: hidden; color: var(--muted); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.btn-draw .icon { margin-right: 2px; }
@media (min-width: 1024px) and (max-width: 1379px) {
  .ev-bar { max-width: 190px; }
  .ev-bar .ev-num.is-bar { width: 36px; height: 36px; font-size: 16px; }
}

/* The repair button (a road is broken). */
.build-repair { display: inline-flex; align-items: center; gap: 5px; color: var(--danger-text); }

/* Broken roads on the board: the color in pieces and a crack. */
.road-broken { stroke-dasharray: 9 6; stroke-linecap: butt; }
.seg-ring { fill: var(--accent); fill-opacity: .22; stroke: var(--accent); stroke-width: 2.5; pointer-events: none; animation: pulse 1.6s ease-in-out infinite; }
.target-edge:hover .seg-ring, .target-edge:focus-visible .seg-ring { fill-opacity: .5; animation: none; }

/* The choice dialog of an event. */
.ev-choice-intro { display: flex; align-items: flex-start; gap: 12px; }
.ev-choice-icon {
  --ev: var(--accent);
  display: inline-flex; flex: none; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px;
  background: color-mix(in srgb, var(--ev) 20%, transparent); color: color-mix(in srgb, var(--ev) 70%, #fff);
}
.ev-choice-prompt { margin: 2px 0 0; font-weight: 600; }
.ev-choice-note { margin: -4px 0 0; }
.victim.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.modal-eventChoice .modal-foot > .muted { margin-right: auto; }

/* The deck dialog. */
.modal-eventDeck .modal-body { align-items: center; }
.ev-deck-line { display: flex; align-items: flex-start; gap: 8px; margin: 0; color: var(--text-2); font-size: 13px; }
.ev-deck-line .icon { flex: none; margin-top: 2px; color: var(--accent); }
.ev-history { width: 100%; }
.ev-history-title { margin: 4px 0 8px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.ev-history-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.ev-history-list li { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--row); font-size: 13px; }

/* «Правила этой партии»: the event cards. */
.rules-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin: 10px 0; }
.rules-card { padding: 10px 12px; border-radius: 12px; background: var(--row); font-size: 13px; }
.rules-card p { margin: 4px 0 0; color: var(--text-2); }


/* «Рыбаки Катана»: catch tokens, the «Улов» button and dialog, the old boot. */
.fish-token {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-width: 30px; height: 34px; padding: 2px 5px; border: 1px solid rgba(99, 211, 214, 0.45); border-radius: 9px;
  background: linear-gradient(180deg, #1F5F7A, #174A60); color: #E6F6F8; font: inherit; line-height: 1;
}
.fish-token b { font-family: var(--font-display); font-size: 14px; font-weight: 700; }
.fish-token-marks { display: inline-flex; gap: 0; color: #7FE0E6; }
.fish-token.fish-v2 { background: linear-gradient(180deg, #23708C, #195870); }
.fish-token.fish-v3 { background: linear-gradient(180deg, #2A86A2, #1D6884); border-color: rgba(127, 224, 230, 0.75); }
button.fish-token { cursor: pointer; min-width: 44px; height: 46px; border-radius: 12px; }
button.fish-token b { font-size: 17px; }
button.fish-token:hover { border-color: var(--accent); }
.fish-token.is-selected { border: 2px solid var(--accent); box-shadow: 0 0 0 3px rgba(244, 183, 64, 0.18); }

/* A strip under the hand (the catch, the gold): a row; on phones the whole strip is one button. */
.res-strip { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 5px 8px; border-radius: 12px; background: var(--row); min-width: 0; }
.res-strip.is-hot { box-shadow: inset 0 0 0 1px var(--accent-line); }
button.res-strip { width: 100%; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }

.fish-strip-label { display: inline-flex; flex: none; align-items: center; gap: 5px; color: #7FE0E6; font-size: 13px; font-weight: 600; }
.fish-strip-tokens { display: flex; flex: 1 1 auto; flex-wrap: nowrap; gap: 4px; min-width: 0; overflow: hidden; }
.fish-strip .fish-token { min-width: 24px; height: 28px; padding: 1px 4px; border-radius: 7px; }
.fish-strip .fish-token b { font-size: 12px; }
.fish-strip .fish-token-marks { display: none; }
.fish-strip-meta { flex: none; white-space: nowrap; }
.fish-strip-open { flex: none; }
.badge-boot { padding-left: 6px; padding-right: 6px; background: rgba(176, 140, 92, 0.2); color: #E3C79C; }
.side .badge-boot .badge-label { display: none; }
.m-award.m-boot { color: #E3C79C; }

.btn-fish { gap: 6px; }
.btn-fish .fish-count {
  min-width: 20px; padding: 1px 6px; border-radius: 999px; background: rgba(99, 211, 214, 0.18); color: #9EE7EA;
  font-family: var(--font-display); font-size: 12px; font-weight: 700;
}
@media (min-width: 1024px) and (max-width: 1519px) {
  .btn-fish .btn-label { display: none; }
}

.modal-fish .modal-body { gap: 12px; }
.fish-mine { display: flex; flex-direction: column; gap: 8px; }
.fish-mine-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.fish-tokens { display: flex; flex-wrap: wrap; gap: 6px; }
.fish-pick-note { margin: 0; }
.fish-options { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.fish-option { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; background: var(--row); }
.fish-option.is-off .fish-option-text b { color: var(--muted); }
.fish-cost {
  display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 3px; width: 54px; height: 36px; border-radius: 10px;
  background: rgba(99, 211, 214, 0.14); color: #9EE7EA;
}
.fish-cost b { font-family: var(--font-display); font-size: 17px; }
.fish-option.is-off .fish-cost { opacity: .55; }
.fish-option-text { flex: 1 1 auto; min-width: 0; }
.fish-option-note { display: block; margin-top: 2px; color: var(--accent-text); }
.fish-option-note.muted { color: var(--muted); }
.fish-swap { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(244, 183, 64, 0.1); }
.fish-swap .modal-text { margin: 0; }
.fish-boot { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(176, 140, 92, 0.14); }
.fish-boot .modal-text { margin: 0; }
.fish-boot .icon { color: #E3C79C; vertical-align: -3px; }
.fish-boot-targets { display: flex; flex-wrap: wrap; gap: 6px; }
.fish-boot-targets .btn { gap: 6px; }
.fish-supply { margin: 0; }
.rules-fish-table { width: 100%; margin: 8px 0; border-collapse: collapse; font-size: 13px; }
.rules-fish-table th, .rules-fish-table td { padding: 5px 8px; border-bottom: 1px solid var(--line-2); text-align: left; }
.rules-fish-table td:first-child { width: 60px; font-family: var(--font-display); font-weight: 700; color: #9EE7EA; }


/* Lobby «Сценарий»: radio rows above the variants. */
.scenario-group { margin-bottom: 4px; }
.scenario-radio { border-radius: 50%; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Ccircle cx='11' cy='11' r='9.5' fill='%230F2433' stroke='%237F96A6' stroke-width='2'/%3E%3C/svg%3E"); }
.scenario-radio:checked { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Ccircle cx='11' cy='11' r='10' fill='%23F4B740'/%3E%3Ccircle cx='11' cy='11' r='4' fill='%231F1606'/%3E%3C/svg%3E"); }
.scenario-row[data-scenario="none"] .variant-short { font-size: 12px; }
.variant-short.is-warn, .variant-row.is-on .variant-short.is-warn { color: var(--accent-text); }
.scenario-row.is-problem { border-color: rgba(224, 82, 74, 0.6); background: rgba(224, 82, 74, 0.08); }
.scenario-row.is-problem .variant-short.is-warn { color: var(--danger-text); }
.lobby-problem { margin: 0; }
.fish-option-title, .fish-option-line { display: block; }

/* «Катанские реки»: gold coins, the «Золото» button and dialog, the titles, bridges. */
.coin-count { display: inline-flex; align-items: center; gap: 3px; color: var(--gold); font-variant-numeric: tabular-nums; }
.coin-count b { font-family: var(--font-display); font-size: 12.5px; font-weight: 700; }
.chips .coin-count.chip-gold, .trade-summary .coin-count, .trade-done .coin-count {
  padding: 2px 7px; border-radius: 8px; background: rgba(242, 193, 78, 0.16);
}
.stat .icon-coin { color: var(--gold); }
.badge-rich { background: rgba(242, 193, 78, 0.2); color: var(--gold); }
.badge-poor { background: rgba(217, 138, 122, 0.26); color: var(--poor); }
.side .player-row .badge-rich .badge-label, .side .player-row .badge-poor .badge-label { display: none; } /* the players card: icons */
.side .badge-rich, .side .badge-poor { padding-left: 6px; padding-right: 6px; }
.m-award.m-rich { color: var(--gold); }
.m-award.m-poor { color: var(--poor); }
.m-player-gold { display: inline-flex; flex: none; align-items: center; gap: 2px; color: var(--gold); font-size: 12px; font-weight: 600; }

.gold-strip-label { display: inline-flex; flex: none; align-items: center; gap: 5px; color: var(--gold); font-size: 13px; font-weight: 600; }
.gold-strip-count { font-family: var(--font-display); font-size: 16px; color: var(--gold); }
.gold-strip-meta { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.gold-strip .badge { flex: none; }
.gold-strip-open { flex: none; }

.build-bridge { display: inline-flex; align-items: center; gap: 5px; color: #9ADCF2; }

.gold-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.gold-big { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); }
.gold-big b { font-family: var(--font-display); font-size: 26px; }
.gold-note { margin: 0; }
.gold-table { display: flex; flex-direction: column; gap: 4px; }
.gold-row { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 10px; background: var(--row); }
.gold-row.is-me { box-shadow: inset 0 0 0 1px rgba(242, 193, 78, 0.35); }
.gold-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; }
.gold-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gold-how { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }
.res-option-card.gold-card { background: linear-gradient(160deg, #F6D06A, #C9952A); color: var(--gold-ink); }
.gold-option small { color: var(--muted); }
.res-tile.gold-tile { background: linear-gradient(160deg, #F6D06A, #C9952A); color: var(--gold-ink); }
.modal-gold .modal-body { gap: 12px; }
.rules-gold-table td:first-child { color: var(--gold); }
/* «Катанские реки»: five build buttons — tighter on mid-size desktops so the action bar keeps one row. */
@media (min-width: 1024px) and (max-width: 1519px) {
  .build-group.has-bridge { gap: 6px; }
  .build-group.has-bridge .build-btn { padding-left: 8px; padding-right: 8px; }
  .build-group.has-bridge .build-btn.is-active { padding-left: 7px; padding-right: 7px; }
  .build-group.has-bridge .build-bridge .icon { display: none; }
}
@media (min-width: 1024px) and (max-width: 1379px) {
  .build-group.has-bridge { gap: 5px; }
  .build-group.has-bridge .build-btn { padding-left: 6px; padding-right: 6px; }
  .build-group.has-bridge .build-btn.is-active { padding-left: 5px; padding-right: 5px; }
}
.gold-done { display: inline-flex; align-items: center; gap: 5px; color: var(--accent-text); }
