/* /game/css/ui-round.css */

/* ==============================
   Hidden Cask — Round UI
   Scoring table, player focus, serve style, notes toggle and dev bar support
============================== */

.hc-round-table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.hc-score-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 720px;
  table-layout: fixed;
}

.hc-score-table.hc-solo-layout {
  width: 420px;
  min-width: 420px;
  max-width: 420px;
  margin-left: 0;
}

.hc-score-table th,
.hc-score-table td {
  vertical-align: top;
}

.hc-score-table .bottle-head,
.hc-score-table .bottle-col {
  width: 92px;
  min-width: 92px;
  max-width: 92px;
}

.hc-score-table .sticky-col {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #f6f6f6;
}

.hc-score-table thead .sticky-col {
  z-index: 5;
  background: #f1f1f1;
}

.hc-score-table th.player-head,
.hc-score-table th.bottle-head {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
}

.hc-score-table th.player-head.active {
  outline: 2px solid rgba(139,69,19,.35);
  outline-offset: -2px;
}

.hc-score-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 74px;
}

.hc-score-cell .score-select {
  width: 98px;
  max-width: 100%;
}

.hc-score-cell .hc-note-input {
  width: 95%;
  max-width: 180px;
}

.hc-score-table.hc-solo-layout th.player-head,
.hc-score-table.hc-solo-layout td[data-col] {
  width: 220px;
}

.hc-note-input.hc-notes-hidden {
  display: none !important;
}

#ratingArea td.dim {
  opacity: .45;
}

/* Focus bar */

.hc-focus-bar--clean {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.hc-focus-state {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 220px;
}

.hc-focus-hint {
  opacity: .78;
}

.hc-focus-name {
  font-weight: 700;
}

.hc-focus-clear {
  border: 0;
  background: #444;
  color: #fff;
  border-radius: 999px;
  width: 24px;
  height: 24px;
  line-height: 24px;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
}

/* Toggle tooltip */

.hc-toggle-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  cursor: help;
}

.hc-toggle-help[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  max-width: 280px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(20,20,20,.95);
  color: #fff;
  font-size: .82rem;
  line-height: 1.35;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .15s ease, transform .15s ease;
  z-index: 20;
}

.hc-toggle-help[data-tip]:hover::after,
.hc-toggle-help[data-tip]:focus-within::after {
  opacity: 1;
  transform: translateY(0);
}

/* Serve style header badge */

.hc-round-main {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.hc-serve-header-badge {
  margin-left: auto;
  align-self: flex-start;
  display: none;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 248, 220, 0.18);
  border: 1px solid rgba(255, 248, 220, 0.35);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.hc-serve-header-badge.is-visible {
  display: inline-flex;
}

.hc-serve-header-icon {
  font-size: 18px;
  line-height: 1;
}

/* Serve style selector */

.hc-serve-style-box {
  max-width: 520px;
  margin: 0 auto 18px;
  padding: 16px;
  background: rgba(255, 248, 220, 0.85);
  border: 1px solid rgba(139, 69, 19, 0.25);
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.hc-serve-style-box.needs-choice {
  border-color: rgba(180, 83, 9, 0.65);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18), 0 2px 8px rgba(0,0,0,.06);
}

.hc-serve-style-box.is-collapsed {
  max-width: 420px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.hc-serve-style-box.is-collapsed .hc-serve-style-title {
  display: none;
}

.hc-serve-style-box.is-collapsed .hc-serve-style-toggle {
  display: none;
}

.hc-serve-style-box.is-collapsed .hc-serve-style-subtitle {
  margin-bottom: 0;
  font-weight: 600;
}

.hc-serve-style-title {
  font-weight: 700;
  color: #8B4513;
  margin-bottom: 4px;
  font-size: 17px;
}

.hc-serve-style-subtitle {
  font-size: 14px;
  color: #5f5146;
  margin-bottom: 12px;
}

.hc-serve-style-warning {
  margin-top: 10px;
  color: #92400e;
  font-size: 14px;
  font-weight: 700;
}

.hc-serve-style-toggle {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hc-serve-style-btn {
  appearance: none;
  border: 1px solid rgba(139, 69, 19, 0.3);
  background: #fff;
  color: #8B4513;
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
}

.hc-serve-style-btn:hover {
  transform: translateY(-1px);
}

.hc-serve-style-btn.is-active {
  background: #8B4513;
  color: #fff;
  border-color: #8B4513;
}

.hc-serve-change-btn {
  margin-left: 8px;
  border: 0;
  border-radius: 999px;
  padding: 4px 9px;
  background: #8B4513;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

/* Responsive */

@media (max-width: 900px) {
  .hc-score-table {
    min-width: 860px;
  }

  .hc-score-table.hc-solo-layout {
    min-width: 420px;
    max-width: 420px;
  }

  .hc-score-table .bottle-head,
  .hc-score-table .bottle-col {
    width: 84px;
    min-width: 84px;
    max-width: 84px;
  }

  .hc-score-table th.player-head,
  .hc-score-table th.bottle-head {
    font-size: 0.9rem;
  }

  .hc-focus-state {
    min-width: unset;
  }
}

@media (max-width: 640px) {
  .hc-round-main {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .hc-serve-header-badge {
    margin-left: 0;
    margin-top: 8px;
  }
}

@media (max-width: 520px) {
  .hc-serve-style-box {
    margin-left: 8px;
    margin-right: 8px;
  }

  .hc-serve-style-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .hc-serve-style-btn {
    width: 100%;
  }
}

/* -------------------------------------------------------
   Hidden Cask - Game Options Bar
   Notes / Voice / Player Focus
------------------------------------------------------- */

.hc-game-options-bar {
  width: min(940px, calc(100% - 24px));
  margin: 12px auto 14px;
  padding: 10px 12px;

  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;

  background: rgba(18, 10, 6, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(6px);
}

.hc-game-option {
  min-height: 38px;
  padding: 8px 14px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;

  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff7ed;

  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);

  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

button.hc-game-option {
  appearance: none;
  -webkit-appearance: none;
}

.hc-game-option:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 220, 170, 0.35);
  transform: translateY(-1px);
}

.hc-game-option.is-on {
  background: rgba(154, 87, 38, 0.96);
  border-color: rgba(255, 220, 170, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.hc-option-icon {
  font-size: 16px;
  line-height: 1;
}

.hc-focus-status {
  margin-left: auto;
  cursor: default;
  background: rgba(255, 255, 255, 0.10);
}

.hc-focus-status:hover {
  transform: none;
}

.hc-focus-reset {
  margin-left: 5px;
  padding: 5px 10px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 0;
  border-radius: 999px;
  background: #f3d7ad;
  color: #5b2f12;

  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;

  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
}

.hc-focus-reset:hover {
  background: #fff0d4;
}

.hc-notes-hidden {
  display: none !important;
}

/* Mobile layout */
@media (max-width: 720px) {
  .hc-game-options-bar {
    width: calc(100% - 20px);
    border-radius: 18px;
    justify-content: stretch;
    padding: 10px;
  }

  .hc-game-option,
  .hc-focus-status {
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }

  .hc-focus-reset {
    margin-left: 8px;
  }
}

/* Hide main intro/header while actively playing a round */
body:has(#ratingArea .hc-round-wrap) .hc-hero {
  display: none !important;
}

/* Game option tooltip */
.hc-has-tip {
  position: relative;
}

.hc-has-tip[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);

  width: 330px;
  max-width: calc(100vw - 40px);
  padding: 10px 12px;

  border-radius: 10px;
  background: rgba(18, 10, 6, 0.96);
  color: #fff7ed;

  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;

  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.14);

  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 50;
}

.hc-has-tip[data-tip]:hover::after,
.hc-has-tip[data-tip]:focus-within::after {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 720px) {
  .hc-has-tip[data-tip]::after {
    left: 50%;
    right: auto;
    bottom: calc(100% + 10px);
    transform: translate(-50%, -4px);
    text-align: center;
  }

  .hc-has-tip[data-tip]:hover::after,
  .hc-has-tip[data-tip]:focus-within::after {
    transform: translate(-50%, 0);
  }
}

/* -------------------------------------------------------
   Hidden Cask - Sample Row Focus
------------------------------------------------------- */

.hc-sample-focus-status {
  cursor: default;
  background: rgba(255, 255, 255, 0.10);
}

.hc-sample-focus-status:hover {
  transform: none;
}

#ratingArea tr.active-row > td {
  background: rgba(255, 248, 220, 0.58);
}

#ratingArea tr.dim-row {
  opacity: 0.48;
}

#ratingArea tr.dim-row td {
  background: rgba(255, 255, 255, 0.72);
}

#ratingArea td.bottle-col.active-row-focus {
  outline: 2px solid rgba(139, 69, 19, 0.42);
  outline-offset: -2px;
  background: rgba(255, 244, 214, 0.95) !important;
}

#ratingArea td.dim {
  opacity: 0.38;
}

#ratingArea td.dim select,
#ratingArea td.dim input {
  pointer-events: none;
}

@media (max-width: 720px) {
  .hc-sample-focus-status {
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }
}

/* ==============================
   Hidden Cask - Round Action Buttons
============================== */

.hc-round-actions {
  display: flex;
  justify-content: center;
  margin: 30px auto 10px;
  padding: 0 16px;
}

.hc-finish-game-btn {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  background: linear-gradient(180deg, #b9564f 0%, #9f3f39 100%);
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(159, 63, 57, 0.28);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease;
}

.hc-finish-game-btn:hover,
.hc-finish-game-btn:focus {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(159, 63, 57, 0.34);
  filter: brightness(1.03);
  outline: none;
}

.hc-finish-game-btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(159, 63, 57, 0.25);
}

@media (max-width: 700px) {
  .hc-round-actions {
    margin-top: 24px;
  }

  .hc-finish-game-btn {
    width: min(100%, 360px);
    padding: 15px 18px;
  }
}