/* Shared styles of the event pages (moved from the former all-in-one events.html). */
body{position:relative;font-family:'Montserrat',Arial,sans-serif;}
/* SVG flag styling */
.flag-icon {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  vertical-align: middle;
}
/* Fix flag alignment in language button */
#langIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
}
body::before{
  content:'';position:fixed;inset:0;z-index:-1;pointer-events:none;opacity:.98;
  background:
    radial-gradient(ellipse at 65% 20%, #f1d9a3cc 0%, transparent 65%),
    radial-gradient(ellipse at 30% 85%, #5d050550 0%, transparent 70%),
    linear-gradient(135deg,#2d1a07 0%,#3e2611 45%,#f1d9a3 110%);
}
.main-content{position:relative;z-index:100;}
.dropdown{position:absolute;right:2rem;top:2rem;z-index:1;}
.event-card {
  transition: all 0.3s ease;
}
.event-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}
.event-content.open {
  max-height: none;
  padding: 1.5rem;
  overflow: visible;
}
@media (max-width: 640px) {
  .event-content.open {
    padding: 1rem;
    font-size: 0.875rem;
    max-height: none;
    overflow: visible;
  }
  .event-content.open h3 {
    font-size: 1rem;
  }
  .event-content.open h4 {
    font-size: 0.9rem;
  }
  .event-content img:not(.event-showcase-image) {
    max-width: 1.25rem !important;
    height: auto !important;
    margin: 0 0.25rem !important;
    vertical-align: middle;
  }
  .event-content p, .event-content li {
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
  }
  /* Special handling for showcase images - should remain visible on mobile */
  .event-showcase-image {
    max-width: 100% !important;
    height: auto !important;
    margin: 0.5rem 0 !important;
  }
  /* Seer solver: cards should stay large and unaffected by the generic mobile image cap */
  #seer-solver-color-step img {
    max-width: none !important;
    width: 7rem !important;
    height: 7rem !important;
    margin: 0 !important;
  }
  #seer-solver-rec-card {
    max-width: none !important;
    width: auto !important;
    height: 8rem !important;
    margin: 0 !important;
  }
}
.event-header {
  cursor: pointer;
  border-radius: 0.75rem 0.75rem 0 0;
  transition: background 0.3s ease;
}
.event-header.open {
  background: linear-gradient(to right, #5D0505, #341002) !important;
}
.expand-icon {
  transition: transform 0.3s ease;
}
.expand-icon.rotated {
  transform: rotate(180deg);
}
.tips-list {
  list-style: none;
  padding-left: 0;
}
.tips-list li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.25rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.tips-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0rem;
  color: currentColor;
  font-weight: bold;
}
@media (max-width: 640px) {
  .tips-list li {
    font-size: 0.875rem;
    line-height: 1.4;
    padding-left: 1rem;
  }
  .tips-list li img:not(.event-showcase-image) {
    max-width: 1rem !important;
    height: auto !important;
    vertical-align: middle;
  }
}
.treasure-ticket-highlight {
  background: rgba(93, 5, 5, 0.1);
  border: 1px solid rgba(93, 5, 5, 0.3);
  border-radius: 0.375rem;
  padding: 0.25rem 0.5rem;
  margin: 0.125rem 0;
  display: inline-block;
  position: relative;
  cursor: help;
  transition: all 0.3s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
@media (max-width: 640px) {
  .treasure-ticket-highlight {
    padding: 0.125rem 0.25rem;
    font-size: 0.875rem;
    line-height: 1.3;
    margin: 0.0625rem 0;
  }
  .treasure-ticket-highlight img:not(.event-showcase-image) {
    max-width: 1rem !important;
    height: auto !important;
    margin: 0 0.25rem !important;
  }
}
.treasure-ticket-highlight:hover {
  background: rgba(93, 5, 5, 0.2);
  border-color: rgba(93, 5, 5, 0.5);
  box-shadow: 0 2px 8px rgba(93, 5, 5, 0.2);
}
.tooltip {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(52, 16, 2, 0.98);
  color: #F1D9A3;
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(241, 217, 163, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 9999999 !important;
  margin-top: 0.5rem;
  width: 380px;
  max-width: calc(100vw - 2rem);
  white-space: normal;
  text-align: center;
  pointer-events: none;
  backdrop-filter: blur(2px);
}

.tooltip::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  bottom: 100%;
  border-bottom: 5px solid rgba(52, 16, 2, 0.98);
}

/* Arrow pointing down (tooltip above element) */
.tooltip.tooltip-above::after {
  top: 100%;
  bottom: auto;
  border-top: 5px solid rgba(52, 16, 2, 0.98);
  border-bottom: none;
}
.treasure-ticket-highlight:hover .tooltip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.treasure-ticket-highlight {
  position: relative;
  overflow: visible;
  z-index: 1;
}

/* Enhanced z-index management for all tooltips */
.treasure-ticket-highlight:hover {
  z-index: 9999998;
}

.treasure-ticket-highlight:hover .tooltip {
  z-index: 9999999 !important;
}

/* Special high-priority tooltip for Ring der tödlichen Macht */
.ring-tooltip-priority .tooltip {
  z-index: 9999999 !important;
}
.ring-tooltip-priority:hover .tooltip {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 9999999 !important;
}

/* Mobile optimization for all text content */
@media (max-width: 640px) {
  .event-content p, .event-content li {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
  }
  .event-content .inline {
    max-width: 1rem;
    height: auto;
    margin: 0 0.125rem;
  }
  /* Mobile grid optimization */
  .event-content .grid {
    gap: 0.5rem !important;
  }
  .event-content .grid-cols-1 {
    grid-template-columns: 1fr !important;
  }
  .event-content .md\\:grid-cols-3 {
    grid-template-columns: 1fr !important;
  }
  .event-content .md\\:grid-cols-5 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  /* Mobile flex optimization */
  .event-content .flex-col {
    flex-direction: column !important;
  }
  .event-content .md\\:flex-row {
    flex-direction: column !important;
  }
  .event-content .flex {
    flex-direction: column !important;
  }
  /* Seer solver: keep these rows side-by-side even on mobile */
  .event-content .seer-solver-row {
    flex-direction: row !important;
  }
  /* Okey advisor: the hand is a card row, never a column */
  .event-content #okey-advisor-hand-display {
    flex-direction: row !important;
  }
  /* ...same for the advisor rows that only make sense side-by-side:
     score display, toggle+reset, and the simulation-stats line (which
     otherwise collapses to ~31px with the separator dots on own lines) */
  .event-content #okey-advisor-score-display,
  .event-content .okey-keep-row {
    flex-direction: row !important;
  }
  /* ...and its cards are full playing cards, so exempt them from the
     1.25rem inline-icon cap above; their own width rules apply instead */
  .event-content #okey-advisor-hand-display img {
    max-width: none !important;
  }
  /* Ensure proper spacing for mobile */
  .event-content > * {
    margin-bottom: 1rem;
  }
  .event-content > *:last-child {
    margin-bottom: 0;
  }
}

/* Okey advisor: play-style switch (gold-chasing vs balanced) */
.okey-mode-btn {
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: transparent;
  color: #341002;
  opacity: 0.55;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
}
.okey-mode-btn:hover { opacity: 0.85; }
.okey-mode-btn.active {
  background: #341002;
  color: #F1D9A3;
  opacity: 1;
  cursor: default;
}
/* Gleich breite Ziffern, damit die Quotenzeile beim Umschalten der
   Spielweise nicht springt (in den meisten Schriften ist die 1 schmaler) */
#okey-rate-gold, #okey-rate-silver, #okey-rate-bronze {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Custom grid for rewards table - first column 25%, others equal */
.rewards-grid-custom {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem;
}

@media (min-width: 640px) {
  .rewards-grid-custom {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
}

@media (min-width: 1024px) {
  .rewards-grid-custom {
    grid-template-columns: 1fr 2fr 2fr;
    gap: 0.5rem;
  }
}

/* Okey loot list table styling (match King loot style) */
.okey-loot-list table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
}
.okey-loot-list table tr {
  background: linear-gradient(to right, rgba(255,255,255,0.8), rgb(255, 251, 235));
}
.okey-loot-list table tr td {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border-top: 1px solid rgb(253, 230, 138);
  border-bottom: 1px solid rgb(253, 230, 138);
  text-align: left;
}
.okey-loot-list table tr td:first-child {
  font-weight: 500;
  color: #341002;
  border-left: 1px solid rgb(253, 230, 138);
  border-radius: 0.375rem 0 0 0.375rem;
}
.okey-loot-list table tr td:last-child {
  font-weight: 700;
  color: #5D0505;
  white-space: nowrap;
  text-align: right;
  border-right: 1px solid rgb(253, 230, 138);
  border-radius: 0 0.375rem 0.375rem 0;
}
.okey-loot-list table tr td img {
  width: 1.5rem;
  height: 1.5rem;
}
.okey-loot-list table tr:hover {
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Active Event Styles */
.card-active {
  position: relative;
  border: 4px solid #22c55e !important; /* Complete green border override */
  animation: pulse-green-border 2s ease-in-out infinite;
}

.card-active::before {
  content: attr(data-active);
  position: absolute;
  top: 16px;
  right: 16px;
  background: #22c55e;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 10;
}

@keyframes pulse-green-border {
  0%, 100% {
    border-color: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
  }
  50% {
    border-color: #16a34a;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.8);
  }
}

/* Coming-Soon Styles */
.card-coming-soon{
  position: relative;
  filter: grayscale(.3) brightness(.9);
  pointer-events: none;
}

.card-coming-soon::after{
  content: attr(data-soon);
  position: absolute;
  inset: 0;
  margin: auto;
  width: 75%;
  max-width: 260px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-12deg);
  background: rgba(93,5,5,.92);
  color: #F1D9A3;
  font-weight: 700;
  letter-spacing: .08em;
  font-size: 1.1rem;
  border: 2px solid #F1D9A3;
  border-radius: .6rem;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 5;
  text-align: center;
  line-height: 1.2;
}

/* Okey Helper Styles */
.okey-action-btn {
  background: #5D0505;
  color: #F1D9A3;
  border-radius: 4px;
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  transition: background 0.2s, opacity 0.2s;
}
.okey-action-btn:hover { background: #341002; }
.okey-action-btn-ghost {
  background: transparent;
  color: #341002;
  border: 1px solid rgba(52, 16, 2, 0.35);
  font-weight: 500;
}
.okey-action-btn-ghost:hover { background: rgba(52, 16, 2, 0.1); color: #341002; }
/* Selected-but-not-recommended card: clearly picked, but not the green advice */
.okey-hand-slot.play-selected:not(.advisor-play) {
  border-radius: 4px;
  outline: 3px solid #341002;
  outline-offset: 1px;
}
#okey-advisor-needed.okey-out-of-reach {
  color: #5D0505;
  font-weight: 600;
}
/* Points table: three side-by-side tables with real card images, matching
   the overview players know from the game. */
.okey-points-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}
.okey-points-col {
  background: rgba(52, 16, 2, 0.06);
  border: 1px solid rgba(52, 16, 2, 0.18);
  border-radius: 0.5rem;
  overflow: hidden;
}
.okey-points-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.okey-points-caption {
  background: #5D0505;
  color: #F1D9A3;
  font-weight: 700;
  text-align: center;
  padding: 0.4rem 0.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
}
.okey-points-th-cards,
.okey-points-th-value {
  background: rgba(52, 16, 2, 0.14);
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  font-size: 0.72rem;
  color: #341002;
}
.okey-points-th-cards { text-align: left; }
.okey-points-th-value { text-align: right; white-space: nowrap; }
.okey-points-table td {
  border-top: 1px solid rgba(52, 16, 2, 0.12);
  padding: 0.25rem 0.6rem;
  vertical-align: middle;
}
.okey-points-cards { line-height: 0; white-space: nowrap; }
.okey-points-cards img {
  width: 26px;
  height: auto;
  border-radius: 2px;
  display: inline-block;
  margin-right: 3px;
}
.okey-points-cards img:last-child { margin-right: 0; }
.okey-points-value {
  text-align: right;
  font-weight: 700;
  color: #341002;
  white-space: nowrap;
}
.okey-points-table tbody tr:hover { background: rgba(52, 16, 2, 0.07); }
@media (max-width: 767px) {
  .okey-points-grid { grid-template-columns: 1fr; gap: 0.75rem; }
}
.okey-card {
  position: relative;
}
.okey-card.played {
  opacity: 0.4;
  filter: grayscale(100%);
}
.okey-card.played::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(93, 5, 5, 0.9);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  pointer-events: none;
}

/* Okey Advisor Styles */
/* A card in hand is SELECTED, not gone — it must not share the greyed-out
   look of .played, otherwise picking your hand reads as removing cards. */
.okey-card.hand {
  opacity: 1;
  filter: none;
}
.okey-card.hand img {
  outline: 3px solid #5D0505;
  outline-offset: 1px;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(93, 5, 5, 0.45);
}
/* Typing the score directly beats clicking +10 up to 38 times */
.okey-score-input {
  width: 4.5ch;
  background: rgba(241, 217, 163, 0.75);
  border: 1px solid rgba(52, 16, 2, 0.3);
  border-radius: 4px;
  padding: 1px 4px;
  font-weight: bold;
  font-size: 16px;   /* below 16px iOS zooms the page on focus */
  color: #341002;
  text-align: right;
  -moz-appearance: textfield;
}
.okey-score-input::-webkit-outer-spin-button,
.okey-score-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.okey-score-input:focus {
  outline: 2px solid #5D0505;
  outline-offset: 1px;
}
.okey-score-adjust {
  width: 26px;
  height: 26px;
  line-height: 1;
  font-weight: bold;
  font-size: 14px;
  color: #F1D9A3;
  background: #341002;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.okey-score-adjust:hover {
  background: #5D0505;
}
/* Mobile: shrink the 8-column card grid so it fits small screens */
@media (max-width: 639px) {
  #okey-card-grid .okey-card {
    max-width: 2.25rem;
  }
  #okey-card-grid .okey-card img {
    width: 100%;
  }
  /* Scoped to the container ID so these win over the base .okey-hand-slot
     rule below, which would otherwise override them (same specificity,
     but it comes later in the stylesheet) */
  #okey-advisor-hand-display .okey-hand-slot {
    /* 5 slots + 4 gaps of 4px must fit; below ~366px viewport the fixed
       48px would overflow, so shrink to the available share instead */
    width: min(48px, calc((100% - 16px) / 5));
    height: 68px;
  }
  #okey-advisor-hand-display .okey-hand-slot img {
    width: 92%;
  }
  #okey-advisor-hand-display {
    height: 72px !important;
  }
  /* Bigger tap targets for the score steppers on touch screens */
  .okey-score-adjust {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }
}
.okey-hand-slot {
  position: relative;
  transition: transform 0.15s;
  width: 60px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.okey-hand-slot img {
  width: 56px;
  height: auto;
}
@keyframes okey-advisor-play {
  0%,100% { box-shadow: 0 0 0 2px rgba(34,197,94,0.4); }
  50%     { box-shadow: 0 0 0 3px #22c55e, 0 0 14px 5px rgba(34,197,94,0.55); }
}
.okey-hand-slot.advisor-play {
  border-radius: 4px;
  outline: 3px solid #22c55e;
  outline-offset: 1px;
  animation: okey-advisor-play 1.0s ease-in-out infinite;
}
.okey-hand-slot.advisor-discard {
  opacity: 0.45;
  filter: grayscale(60%);
  border-radius: 4px;
  outline: 3px dashed #ef4444;
  outline-offset: 1px;
}
@keyframes okey-computing-pulse {
  from { opacity: 0.3; }
  to   { opacity: 0.7; }
}
#okey-advisor-hand-display.advisor-computing .okey-hand-slot {
  animation: okey-computing-pulse 0.5s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes okey-card-confirm {
  0%   { transform: scale(1);    opacity: 1; }
  20%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(0.5);  opacity: 0; }
}
.okey-hand-slot.confirming {
  animation: okey-card-confirm 0.32s ease-in forwards;
  pointer-events: none;
}
#okey-advisor-score-value {
  display: inline-block;
  min-width: 2.2em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
@keyframes okey-score-pop {
  0%   { opacity: 0;   top: 2px;   }
  18%  { opacity: 1;   top: -5px;  }
  70%  { opacity: 0.9; top: -18px; }
  100% { opacity: 0;   top: -26px; }
}
.okey-score-popup {
  position: absolute;
  left: calc(100% + 12px);
  top: 2px;
  color: #22c55e;
  font-weight: 800;
  font-size: 0.95rem;
  white-space: nowrap;
  pointer-events: none;
  z-index: 20;
  text-shadow: 0 1px 3px rgba(0,0,0,0.12);
  animation: okey-score-pop 1.1s ease-out forwards;
}
.okey-hand-slot.advisor-play.play-selected {
  animation: none;
  box-shadow: 0 0 0 3px #22c55e, 0 0 16px 6px rgba(34,197,94,0.7);
  outline-color: #22c55e;
}
.okey-hand-slot.advisor-play.play-selected::after {
  content: "✓";
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: #16a34a;
  color: white;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  pointer-events: none;
}

/* Fishing Jigsaw Helper Styles */
#fishing-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  max-width: 360px;
}
.fishing-cell {
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  border: 2px solid rgba(52, 16, 2, 0.35);
  background: rgba(52, 16, 2, 0.08);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  cursor: pointer;
}
.fishing-cell:hover {
  transform: scale(1.06);
  border-color: #5D0505;
}
.fishing-cell.filled {
  background: #5D0505;
  border-color: #341002;
}
@keyframes fishing-advisor-place {
  0%, 100% { background: rgba(254, 206, 88, 0.45); box-shadow: 0 0 2px rgba(254, 206, 88, 0.4); }
  50%      { background: rgba(254, 206, 88, 0.9);  box-shadow: 0 0 10px 3px rgba(254, 206, 88, 0.7); }
}
.fishing-cell.advisor-place {
  border-color: #FECE58;
  animation: fishing-advisor-place 1.0s ease-in-out infinite;
}
@keyframes fishing-computing-pulse {
  from { opacity: 0.35; }
  to   { opacity: 0.75; }
}
#fishing-board.advisor-computing .fishing-cell {
  animation: fishing-computing-pulse 0.5s ease-in-out infinite alternate;
  pointer-events: none;
}
.fishing-figure-btn {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(52, 16, 2, 0.08);
  border: 2px solid rgba(52, 16, 2, 0.25);
  border-radius: 8px;
  padding: 4px;
  transition: transform 0.12s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.fishing-figure-btn:hover {
  transform: scale(1.06);
  border-color: #5D0505;
}
.fishing-figure-btn.selected {
  border-color: #FECE58;
  background: rgba(254, 206, 88, 0.25);
  box-shadow: 0 0 8px rgba(254, 206, 88, 0.6);
}
.fishing-figure-img {
  max-width: 42px;
  max-height: 42px;
  object-fit: contain;
  pointer-events: none;
}
.fishing-advice {
  min-height: 1.4rem;
  font-size: 0.875rem;
  text-align: center;
}
.fishing-advice-place {
  color: #16a34a;
  font-weight: 600;
}
.fishing-advice-discard {
  color: #ef4444;
  font-weight: 600;
}
.fishing-adjust {
  width: 22px;
  height: 22px;
  line-height: 1;
  font-weight: bold;
  font-size: 14px;
  color: #F1D9A3;
  background: #341002;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.fishing-adjust:hover {
  background: #5D0505;
}
#fishing-progress-bar {
  height: 6px;
  background: #FECE58;
  border-radius: 9999px;
  width: 0%;
  transition: width 0.2s;
}
/* Three equal-width chest cards (rewards-grid-custom is okey-specific 1fr 2fr 2fr) */
.fishing-rewards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}
@media (min-width: 640px) {
  .fishing-rewards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 639px) {
  .fishing-figure-btn {
    width: 48px;
    height: 48px;
  }
  .fishing-figure-img {
    max-width: 36px;
    max-height: 36px;
  }
}

/* King Helper Styles */
.king-field {
  position: relative;
  width: 100%;
  border-radius: 6px;
  cursor: pointer;
  transition: box-shadow 0.2s, outline-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: 2px solid transparent;
  outline-offset: -2px;
}
.king-field img {
  width: 100%;
  aspect-ratio: 50 / 36;
  display: block;
  border-radius: 4px;
  object-fit: fill;
}
.king-field:hover {
  outline-color: #FECE58;
  box-shadow: 0 0 6px rgba(254, 206, 88, 0.4);
}
.king-field.field-selected {
  outline: 2px solid #60a5fa !important;
  outline-offset: -2px;
  box-shadow: 0 0 6px rgba(96, 165, 250, 0.6) !important;
}
@media (min-width: 640px) {
  .king-field.field-selected {
    outline: 4px solid #60a5fa !important;
    outline-offset: -4px;
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.6) !important;
  }
}
.king-field.revealed {
  outline-color: transparent;
}
.king-field.five-nearby {
  outline: 2px solid #e53e3e;
  outline-offset: -2px;
  box-shadow: 0 0 6px rgba(229, 62, 62, 0.7), inset 0 0 4px rgba(229, 62, 62, 0.4);
}
@media (min-width: 640px) {
  .king-field.five-nearby {
    outline: 4px solid #e53e3e;
    outline-offset: -4px;
    box-shadow: 0 0 12px rgba(229, 62, 62, 0.7), inset 0 0 8px rgba(229, 62, 62, 0.4);
  }
}
.king-field.five-nearby::before {
  content: none;
}
.five-prob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  font-weight: bold;
  color: #fff;
  background: rgba(120, 120, 120, 0.85);
  padding: 1px 3px;
  border-radius: 3px;
  z-index: 3;
  pointer-events: none;
  line-height: 1.3;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
@media (min-width: 640px) {
  .five-prob {
    font-size: 13px;
    padding: 1px 5px;
    border-radius: 4px;
  }
}
.king-field.five-nearby .five-prob {
  background: rgba(229, 62, 62, 0.85);
}
.inline-mouse-icon {
  display: inline-block;
  vertical-align: middle;
  margin: 0 2px;
}
.king-field.five-nearby.field-selected::before {
  content: none;
}
.king-field.five-nearby.revealed {
  outline-color: transparent;
  box-shadow: none;
}
.king-field.five-nearby.revealed::before {
  content: none;
}
.king-own-card {
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
  border-radius: 6px;
  padding: 2px;
  text-align: center;
}
.king-own-card:hover {
  transform: scale(1.05);
}
.king-own-card.selected {
  border: 2px solid #5D0505;
  box-shadow: 0 0 12px rgba(93, 5, 5, 0.9), 0 0 4px rgba(93, 5, 5, 1);
  transform: scale(1.12);
  background: rgba(93, 5, 5, 0.15);
}
.king-own-card.played {
  opacity: 0.4;
  filter: grayscale(100%);
  pointer-events: none;
}
.king-card-count {
  display: block;
  font-size: 12px;
  font-weight: bold;
  color: #341002;
  margin-top: 2px;
}
.king-own-card.played .king-card-count {
  color: #999;
}
.king-own-card.played::after {
  content: "✓";
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(93, 5, 5, 0.9);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  pointer-events: none;
}

/* Purity Table Styles for Water of Life - Medium Size */
.purity-flames-table {
  border-collapse: separate;
  border-spacing: 0;
  background: rgba(241, 217, 163, 0.9);
  border: 2px solid #FECE58;
  border-radius: 10px;
  overflow: visible;
  box-shadow: 0 3px 10px rgba(93, 5, 5, 0.2);
  font-size: 0.9rem;
}

.purity-flames-table thead tr th:first-child {
  border-top-left-radius: 10px;
}

.purity-flames-table thead tr th:last-child {
  border-top-right-radius: 10px;
}

.purity-flames-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 10px;
}

.purity-flames-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 10px;
}

.table-header-cell {
  background: #341002;
  color: #F1D9A3;
  padding: 10px 14px;
  font-weight: bold;
  text-align: center;
  border-right: 1px solid rgba(0, 0, 0, 0.2);
  font-size: 0.85rem;
}

.table-icon-cell {
  background: #341002;
  padding: 8px 10px;
  text-align: center;
  border-right: 1px solid rgba(0, 0, 0, 0.2);
  position: relative;
  font-size: 0.85rem;
  color: #F1D9A3;
  font-weight: bold;
}

.table-icon-cell:last-child {
  border-right: none;
}

.table-row-header {
  background: #341002;
  color: #F1D9A3;
  padding: 10px 14px;
  font-weight: bold;
  text-align: center;
  border-right: 1px solid rgba(0, 0, 0, 0.2);
  font-size: 0.85rem;
}

.table-number-cell {
  background: rgba(241, 217, 163, 1);
  color: #341002;
  padding: 10px 14px;
  text-align: center;
  font-weight: bold;
  border-right: 1px solid rgba(0, 0, 0, 0.2);
  font-size: 0.85rem;
}

.table-number-cell:last-child {
  border-right: none;
}

/* Mobile responsive styles for purity table */
@media (max-width: 640px) {
  .purity-flames-table {
    font-size: 0.75rem;
    border-radius: 8px;
  }

  .table-header-cell,
  .table-row-header {
    padding: 6px 8px;
    font-size: 0.7rem;
  }

  .table-icon-cell {
    padding: 6px 8px;
    font-size: 0.7rem;
  }

  .table-number-cell {
    padding: 6px 8px;
    font-size: 0.7rem;
  }
}

/* Yutnori Calculator Styles - Inspired by Dragon Alchemy */
.yutnori-material-input-row {
  background: rgba(52, 16, 2, 0.1);
  border: 1px solid rgba(254, 206, 88, 0.3);
  border-radius: 0.5rem;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}
.yutnori-material-input-row:hover {
  background: rgba(52, 16, 2, 0.2);
  border-color: rgba(254, 206, 88, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(93, 5, 5, 0.1);
}
.yutnori-material-icon {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  flex-shrink: 0;
}
.yutnori-material-label {
  color: #341002;
  font-weight: bold;
  font-size: 0.875rem;
  min-width: 0;
  flex: 1;
}
.yutnori-material-input-wide {
  background: #341002;
  border: 2px solid #FECE58;
  border-radius: 0.375rem;
  color: #F1D9A3;
  padding: 0.5rem 0.75rem;
  width: 120px;
  text-align: center;
  font-weight: bold;
  transition: all 0.3s ease;
}
.yutnori-material-input-wide:focus {
  outline: none;
  border-color: #F1D9A3;
  background: rgba(52, 16, 2, 0.9);
  box-shadow: 0 0 0 3px rgba(254, 206, 88, 0.2);
}
.yutnori-material-input-wide:hover {
  border-color: #F1D9A3;
}

/* Hide number input arrows */
.yutnori-material-input-wide::-webkit-outer-spin-button,
.yutnori-material-input-wide::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.yutnori-material-input-wide[type=number] {
  -moz-appearance: textfield;
}

/* Mobile optimizations for Yutnori calculator */
@media (max-width: 768px) {
  .yutnori-material-input-row {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }
  .yutnori-material-input-wide {
    width: 100%;
    max-width: 150px;
    margin: 0 auto;
  }
}

/* Back button */
.back-button {
  position: fixed; left: 2rem; top: 2rem; z-index: 1000;
  background: #341002; color: #F1D9A3; text-decoration: none;
  padding: 0.75rem; border-radius: 50%;
  box-shadow: 0 4px 12px rgba(93, 5, 5, 0.2); transition: all 0.3s ease;
}
.back-button:hover { background: #5D0505; transform: scale(1.05); }
@media (max-width: 768px) { .back-button { display: none; } }

/* Respect reduced motion for the pulsing "active" border */
@media (prefers-reduced-motion: reduce) {
  .card-active { animation: none; }
}

/* Brown section header on top of the event content (same as .section-header on other pages) */
.section-header {
  background: #341002;
  padding: 1rem;
  color: #F1D9A3;
}

/* "Weitere Events": endless carousel from right to left, same technique as the
   event banners on index.html (second lap of copies, Web Animations in events-page-core.js) */
.more-events-viewport {
  overflow: hidden;
  border-radius: 12px;
  --more-events-fade: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.5) 14px, #000 28px, #000 calc(100% - 28px), rgba(0, 0, 0, 0.5) calc(100% - 14px), transparent);
  -webkit-mask-image: var(--more-events-fade);
  mask-image: var(--more-events-fade);
}
.more-events-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 80%;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  will-change: transform;
}
@media (min-width: 640px) {
  .more-events-track { grid-auto-columns: calc((100% - 12px) / 2); }
}
@media (min-width: 1024px) {
  .more-events-track { grid-auto-columns: calc((100% - 24px) / 3); }
}
@media (prefers-reduced-motion: reduce) {
  .more-events-viewport { overflow-x: auto; }
  .more-events-track { will-change: auto; }
  .more-events-track [data-copy] { display: none; }
}
