/* ===== ドクロと花 - Game Styles ===== */
:root {
  --game-accent: #F29CB2;
}

body { overflow-x: hidden; }

/* ---- Top Bar ---- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem 1rem;
  background: var(--surface);
  border-bottom: 3px solid var(--color-coral);
  box-shadow: var(--shadow-sm);
}
.top-bar .title {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
}
.top-bar .title a { color: var(--text-muted); transition: color .2s; }
.top-bar .title a:hover { color: var(--game-accent); }
.top-bar .title span { color: var(--text); font-weight: 900; }
.top-bar-actions { display: flex; gap: .4rem; align-items: center; }
.icon-btn {
  background: var(--surface2);
  border: 2px solid var(--surface2);
  color: var(--text-muted);
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: .8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 700;
  transition: border-color .2s, color .2s;
}
.icon-btn:hover { border-color: var(--game-accent); color: var(--game-accent); }

/* ---- Game Page ---- */
.game-page {
  max-width: 600px;
  margin: 0 auto;
  padding: .5rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  min-height: calc(100vh - 48px);
}

/* ---- Setup Phase ---- */
.setup-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.setup-section h4 {
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .5rem;
  font-weight: 700;
}
.start-btn {
  margin-top: .8rem;
  width: 100%;
  padding: .7rem;
  font-size: 1.1rem;
  border-radius: 999px;
  background: var(--color-coral);
  color: #5A3A3A;
  box-shadow: 0 4px 14px rgba(242, 156, 178, .35);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 900;
  transition: box-shadow .2s, transform .1s;
}
.start-btn:hover { box-shadow: 0 6px 20px rgba(242, 156, 178, .5); }
.start-btn:active { transform: scale(.98); }

/* ---- Phase Section ---- */
.phase-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  text-align: center;
}
.phase-label {
  font-size: .7rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .15rem;
}
.phase-sub {
  font-size: .9rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: .6rem;
}

/* ---- Blind Screen placeholders ---- */
.blind-instruction {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: .2rem;
}
.blind-player-name {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: .4rem;
}

/* ---- Stacks Overview ---- */
.stacks-overview {
  margin: .5rem 0;
}
.stacks-row {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  justify-content: center;
}
.stack-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  min-width: 52px;
}
.stack-name {
  font-size: .65rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60px;
}
.stack-cards {
  display: flex;
  flex-direction: column;
  gap: -4px;
  align-items: center;
  position: relative;
  min-height: 28px;
}
.stack-card-down {
  width: 32px;
  height: 22px;
  border-radius: 5px;
  background: linear-gradient(135deg, #1e1b2e, #2d2040);
  color: #6b5d7a;
  font-size: .65rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -6px;
  border: 1.5px solid rgba(255,255,255,.08);
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
}
.stack-card-down:first-child { margin-top: 0; }
.stack-empty {
  font-size: .7rem;
  color: var(--text-muted);
  opacity: .5;
}
.stack-hand-count {
  font-size: .6rem;
  color: var(--text-muted);
  margin-top: .1rem;
}

/* ---- Hand Display ---- */
.hand-label {
  font-size: .75rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: .4rem;
}
.hand-cards {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: .3rem;
}
.hand-card {
  width: 64px;
  height: 88px;
  border-radius: 10px;
  font-size: 2rem;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
}
.hand-card:hover {
  transform: translateY(-6px) scale(1.06);
  box-shadow: 0 8px 20px rgba(0,0,0,.2);
}
.hand-card:active { transform: scale(.96); }
.hand-card-flower {
  background: linear-gradient(135deg, #fdf2f8, #fbcfe8);
  border: 2px solid #f9a8d4;
}
.hand-card-skull {
  background: linear-gradient(135deg, #1e1b2e, #3b1f2b);
  border: 2px solid #7f1d1d;
  color: #fff;
}
.place-hint {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .2rem;
}

/* ---- Bid Trigger Button ---- */
.btn-bid-trigger {
  margin-top: .6rem;
  padding: .55rem 1.5rem;
  font-size: .95rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--game-accent), rgba(242,156,178,.75));
  color: #5A3A3A;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 900;
  box-shadow: 0 3px 12px rgba(242, 156, 178, .3);
  transition: box-shadow .2s, transform .1s;
}
.btn-bid-trigger:hover { box-shadow: 0 5px 18px rgba(242, 156, 178, .45); }
.btn-bid-trigger:active { transform: scale(.97); }

/* ---- Bid Phase ---- */
.bid-display {
  margin: .4rem 0 .3rem;
}
.bid-number {
  font-size: 4rem;
  font-weight: 900;
  color: var(--game-accent);
  line-height: 1;
  transition: transform .15s;
  display: inline-block;
}
.bid-number.bump {
  animation: bid-bump .25s ease-out;
}
@keyframes bid-bump {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.25); color: rgba(242,156,178,.75); }
  100% { transform: scale(1); }
}
.bid-meta {
  font-size: .8rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: .1rem;
}
.bid-max-hint {
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: .3rem;
}
.bid-player-label {
  font-size: 1rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: .5rem;
}
.bid-action-row {
  display: flex;
  gap: .5rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-pass {
  padding: .5rem 1rem;
  font-size: .85rem;
  border-radius: 999px;
  background: var(--surface2);
  border: 2px solid var(--surface2);
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  transition: border-color .15s, color .15s;
}
.btn-pass:hover { border-color: var(--text-muted); color: var(--text); }
.bid-raise-group {
  display: flex;
  align-items: center;
  gap: .3rem;
  background: var(--surface2);
  border-radius: 999px;
  padding: .2rem .3rem;
}
.btn-minus, .btn-plus {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.btn-minus:hover, .btn-plus:hover { background: var(--surface2); }
.bid-input-val {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--game-accent);
  min-width: 2.2rem;
  text-align: center;
  user-select: none;
}
.btn-raise {
  padding: .45rem 1rem;
  font-size: .9rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--game-accent), rgba(242,156,178,.75));
  color: #5A3A3A;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(242, 156, 178, .3);
  transition: box-shadow .15s;
}
.btn-raise:hover { box-shadow: 0 4px 14px rgba(242, 156, 178, .5); }

/* ---- Flip Phase ---- */
.flip-status {
  font-size: 1rem;
  font-weight: 900;
  color: var(--game-accent);
  margin-bottom: .15rem;
}
.flip-progress {
  font-size: .8rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: .5rem;
}
.flip-stacks {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: .4rem 0;
}
.flip-stack-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  padding: .4rem .5rem;
  border-radius: 10px;
  background: var(--surface2);
  transition: background .2s;
  min-width: 60px;
}
.flip-stack-col.flip-stack-active {
  background: rgba(242, 156, 178, .08);
  border: 2px solid var(--game-accent);
}
.flip-stack-name {
  font-size: .65rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70px;
}
.flip-cards-row {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
  justify-content: center;
}
.flip-card {
  width: 38px;
  height: 52px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 900;
  user-select: none;
}
.flip-card-down {
  background: linear-gradient(135deg, #1e1b2e, #2d2040);
  color: #6b5d7a;
  border: 1.5px solid rgba(255,255,255,.08);
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.flip-card-clickable {
  cursor: pointer;
  border: none;
  font-family: inherit;
  animation: flip-pulse 1.2s ease-in-out infinite;
  transition: transform .1s, box-shadow .1s;
}
.flip-card-clickable:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 14px rgba(242, 156, 178, .4);
}
.flip-card-clickable:active { transform: scale(.95); }
@keyframes flip-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 156, 178, .4); }
  50% { box-shadow: 0 0 0 5px rgba(242, 156, 178, 0); }
}
.flip-card-flower {
  background: linear-gradient(135deg, #fdf2f8, #fbcfe8);
  border: 1.5px solid #f9a8d4;
  animation: flower-pop .4s cubic-bezier(.175,.885,.32,1.275) forwards;
}
@keyframes flower-pop {
  0%   { transform: scale(0) rotate(-30deg); opacity: 0; }
  60%  { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.flip-card-skull {
  background: linear-gradient(135deg, #1e1b2e, #7f1d1d);
  border: 1.5px solid #b91c1c;
  animation: skull-shake .5s ease-in-out;
}
@keyframes skull-shake {
  0%   { transform: translateX(0) scale(1); }
  15%  { transform: translateX(-8px) scale(1.1); }
  30%  { transform: translateX(8px) scale(1.05); }
  45%  { transform: translateX(-5px); }
  60%  { transform: translateX(5px); }
  75%  { transform: translateX(-2px); }
  100% { transform: translateX(0) scale(1); }
}
.flip-hint {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: .4rem;
}

/* ---- Round Result ---- */
.result-section { text-align: center; }
.round-result-icon {
  font-size: 3rem;
  margin-bottom: .3rem;
  display: block;
}
.round-result-title {
  font-size: 1.3rem;
  font-weight: 900;
  margin-bottom: .2rem;
}
.round-result-detail {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: .6rem;
}
.scores-row {
  background: var(--surface2);
  border-radius: 10px;
  padding: .5rem .7rem;
  margin-bottom: .6rem;
  text-align: left;
}
.score-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .2rem 0;
  border-bottom: 1px solid rgba(45, 32, 64, .07);
  font-size: .8rem;
}
.score-summary-row:last-child { border-bottom: none; }
.score-summary-name { font-weight: 700; flex: 1; }
.score-summary-hand { flex: 2; text-align: center; letter-spacing: .1em; }
.score-summary-pts { color: var(--game-accent); font-weight: 700; min-width: 30px; text-align: right; }
.next-round-btn {
  padding: .6rem 2rem;
  font-size: 1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--game-accent), rgba(242,156,178,.75));
  color: #5A3A3A;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 900;
  box-shadow: 0 3px 12px rgba(242, 156, 178, .3);
}
.next-round-btn:hover { box-shadow: 0 5px 18px rgba(242, 156, 178, .45); }

/* ---- Final Result ---- */
.final-icon {
  font-size: 3.5rem;
  margin-bottom: .3rem;
}
.final-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--game-accent);
  margin-bottom: .4rem;
}
.final-detail {
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: .8rem;
  line-height: 1.6;
}

/* ---- Scoreboard ---- */
.score-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: .5rem .8rem;
  box-shadow: var(--shadow);
}
.score-section h4 {
  font-size: .7rem;
  color: var(--text-muted);
  margin-bottom: .3rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
}
.score-list {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .8rem;
}
.score-item {
  font-size: .8rem;
  display: flex;
  gap: .3rem;
  align-items: center;
}
.score-item .name { font-weight: 700; }
.score-item .pts { color: var(--game-accent); font-weight: 700; }

/* ---- Log ---- */
.log-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: .5rem .8rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .3rem;
}
.log-header h4 {
  font-size: .7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
}
.clear-log-btn {
  background: var(--surface2);
  border: 2px solid var(--surface2);
  color: var(--text-muted);
  border-radius: 8px;
  padding: .15rem .5rem;
  font-size: .65rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: border-color .2s, color .2s;
}
.clear-log-btn:hover { border-color: var(--game-accent); color: var(--game-accent); }
.log-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .3rem;
  padding: .25rem 0;
  border-bottom: 1px solid var(--surface2);
  font-size: .75rem;
}
.log-entry:last-child { border-bottom: none; }

/* ---- Help Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(90, 58, 58, .3);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay[style*="flex"] { display: flex !important; }
.modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 400px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.modal-box h3 { margin-bottom: .8rem; font-weight: 900; }
.modal-box ul { margin: 0 0 0 1.2rem; line-height: 1.8; font-size: .85rem; color: var(--text-muted); }
.modal-close {
  position: absolute;
  top: .5rem; right: .8rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  transition: color .2s;
}
.modal-close:hover { color: var(--game-accent); }

/* ---- Shared btn override for pink theme ---- */
.btn-primary {
  background: var(--color-coral) !important;
  box-shadow: 0 4px 14px rgba(242, 156, 178, .3) !important;
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(242, 156, 178, .45) !important; }

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .game-page { padding: .4rem .5rem; }
  .hand-card { width: 54px; height: 74px; font-size: 1.7rem; }
  .flip-card { width: 32px; height: 44px; font-size: 1.2rem; }
  .bid-number { font-size: 3rem; }
  .bid-input-val { font-size: 1.3rem; }
}
