@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&family=Zen+Antique+Soft&family=Yuji+Syuku&display=swap');

:root {
  --bg-color: #2d1b14;
  --bg-secondary: #3d2518;
  --card-bg: #f5f0e1;
  --card-border: #8b7355;
  --accent: #c41e3a;
  --accent-hover: #a01830;
  --text: #f5f0e1;
  --text-muted: #a89880;
  --text-dark: #2d1b14;
  --win: #2e8b57;
  --lose: #c41e3a;
  --draw: #daa520;
  --gold: #d4af37;
  --font-brush: 'Yuji Syuku', serif;
  --font-main: 'Zen Antique Soft', serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main), 'Noto Sans JP', sans-serif;
  background: var(--bg-color) url("/assets/backg-c47be8e9.webp") repeat;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.8;
}

/* Header */
.header {
  background: linear-gradient(to bottom, var(--bg-secondary), var(--bg-color));
  padding: 1rem;
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.logo-img {
  height: 36px;
  width: auto;
}

.nav {
  display: flex;
  gap: 1rem;
}

.nav a {
  color: var(--text);
  text-decoration: none;
}

.nav a:hover {
  color: var(--accent);
}

/* ゲーム中はヘッダーを非表示 */
body.games-play .header,
body.games-round_result .header,
body.games-result .header {
  display: none;
}

/* Main */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 0.5rem;
}

/* Flash */
.flash {
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  text-align: center;
}

.flash.notice {
  background: rgb(78, 204, 163);
  border: 1px solid var(--win);
  color: #1a1a2e;
}

.flash.alert {
  background: rgb(233, 69, 96);
  border: 1px solid var(--lose);
  color: #fff;
}

/* Buttons */
.btn {
  font-family: var(--font-brush);
  background: linear-gradient(to bottom, var(--accent), #8b0000);
  color: white;
  border: 2px solid var(--gold);
  padding: 0.8rem 2.5rem;
  font-size: 1.1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.btn:hover {
  background: linear-gradient(to bottom, #d4243e, var(--accent));
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.btn:disabled {
  background: #5a5a5a;
  border-color: #777;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-large {
  padding: 1rem 3rem;
  font-size: 1.3rem;
}

.btn-secondary {
  background: linear-gradient(to bottom, #5a4a3a, #3d2518);
  border-color: var(--card-border);
}

.btn-secondary:hover {
  background: linear-gradient(to bottom, #6a5a4a, #4d3528);
}

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
}

/* Home */
.home {
  text-align: center;
  padding: 0.5rem 1rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-game-links {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.game-link-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: transform 0.2s ease;
  background: rgba(50, 50, 50, 0.8);
  padding: 1rem;
  border-radius: 12px;
}

.game-link-item:hover {
  transform: scale(1.05);
}

.game-link-icon {
  width: 280px;
  height: auto;
}

.game-link-btn {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
  font-weight: bold;
  padding: 0.5rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-link-item:hover .game-link-btn {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.6);
}

.bgm-notice-home {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.home-logo {
  max-width: 280px;
  height: auto;
  display: block;
}

.home-logo-wrapper {
  position: relative;
  display: inline-block;
  overflow: hidden;
  isolation: isolate;
  margin-bottom: 1.5rem;
}

.home-logo-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    transparent 40%,
    rgba(255, 255, 255, 0.7) 50%,
    transparent 60%,
    transparent 100%
  );
  background-size: 300% 100%;
  background-position: 100% 0;
  -webkit-mask-image: url("/assets/logo-03fd7312.webp");
  mask-image: url("/assets/logo-03fd7312.webp");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: top left;
  mask-position: top left;
  animation: shine-mask 1s ease-in-out 0.2s forwards;
  pointer-events: none;
}

@keyframes shine-mask {
  0% {
    background-position: 150% 0;
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  95% {
    background-position: -50% 0;
    opacity: 1;
  }
  100% {
    background-position: -50% 0;
    opacity: 0;
  }
}

@keyframes shine {
  0% {
    left: -100%;
  }
  100% {
    left: 150%;
  }
}

.subtitle {
  font-family: var(--font-main);
  font-size: 1.3rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.guest-notice {
  font-size: 1rem;
  color: #ffeb3b;
  margin-top: 0.3rem;
  margin-bottom: 0;
  font-weight: bold;
  text-shadow: 0 0 8px #000, 0 0 15px #000, 0 0 25px rgba(0, 0, 0, 0.9);
}

.game-description {
  max-width: 700px;
  margin-top: 2rem;
  text-align: left;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  border: 1px solid var(--card-border);
}

.game-description h2 {
  font-family: var(--font-brush);
  font-size: 1.5rem;
  color: var(--gold);
  text-align: center;
  margin-bottom: 0.3rem;
}

.game-description ol {
  padding-left: 1.5rem;
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1.4;
}

.game-description li {
  margin-bottom: 0.2rem;
}

.game-description ol li::marker {
  color: #e91e63;
  font-weight: bold;
}

.game-description .coming-soon {
  text-align: center;
  color: #fff;
  font-size: 0.95rem;
  margin-top: 1rem;
  margin-bottom: 0;
}

.game-description ul {
  padding-left: 1.5rem;
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1.4;
}

.game-description ul li {
  margin-bottom: 0.2rem;
}

.member-benefits {
  margin-top: 1.5rem;
  border-top: 1px solid var(--card-border);
  padding-top: 1.2rem;
}

.member-benefits h3 {
  font-family: var(--font-brush);
  font-size: 1.5rem;
  color: var(--gold);
  text-align: center;
  margin-bottom: 0.2rem;
}

.member-benefits ul {
  padding-left: 1.5rem;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.4;
}

.register-cta {
  text-align: center;
  margin-top: 1.2rem;
}

.btn-register {
  background: linear-gradient(to bottom, var(--gold), #b8960b);
  color: #1a1a2e;
  border-color: #8b7355;
}

.btn-register:hover {
  background: linear-gradient(to bottom, var(--accent), #8b0000);
}

/* Game Setup */
.game-setup {
  max-width: 1080px;
  margin: 0 auto;
  text-align: center;
}

.game-setup h1 {
  font-family: var(--font-brush);
  text-align: center;
  margin-bottom: 2rem;
  color: var(--gold);
  font-size: 2rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.setup-title {
  font-family: var(--font-brush);
  text-align: center;
  margin-bottom: 1rem;
  color: var(--gold);
  font-size: 2rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* Theme Grid - mobile first (vertical stack) */
.theme-grid {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.theme-card {
  background: linear-gradient(135deg, #f5f0e1 0%, #e8e0c8 100%);
  border: 3px solid var(--card-border);
  border-radius: 8px;
  padding: 1.2rem;
  cursor: pointer;
  display: block;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.2);
  transition: all 0.2s;
  text-align: center;
}

.theme-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.theme-card input {
  display: none;
}

.theme-card:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent);
}

.theme-card-placeholder {
  cursor: default;
  opacity: 0.8;
}

.theme-card-placeholder:hover {
  transform: none;
  border-color: var(--card-border);
}

.theme-name {
  font-family: var(--font-brush);
  font-size: 1.5rem;
  color: var(--text-dark);
  display: block;
  margin-bottom: 0.5rem;
}

.theme-desc {
  font-family: var(--font-main);
  font-size: 1rem;
  color: var(--card-border);
}

/* CPU Select Page - Carousel */
.cpu-select {
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
  padding: 0 1rem;
}

.cpu-form {
  text-align: center;
}

.carousel-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.5rem 0;
}

.carousel-track {
  width: 95vw;
  max-width: 600px;
  aspect-ratio: 1 / 1;
  position: relative;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.carousel-slide.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.cpu-image-large {
  width: 100%;
  height: 100%;
  border: 4px solid var(--card-border);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 4px 4px 12px rgba(0,0,0,0.3);
  overflow: hidden;
  background: radial-gradient(ellipse at center, #1a1a2e 0%, #0f0f1a 50%, #050510 100%);
}

.cpu-image-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cpu-image-large .placeholder-text {
  font-family: var(--font-main);
  font-size: 2rem;
  color: var(--text-muted);
  position: absolute;
}

.cpu-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  text-align: center;
  border-radius: 0 0 12px 12px;
}

.cpu-name {
  font-family: var(--font-brush);
  font-size: 1.8rem;
  color: #fff;
  display: block;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.cpu-difficulty {
  font-family: var(--font-main);
  font-size: 1rem;
  padding: 0.2rem 0.8rem;
  border-radius: 20px;
  display: inline-block;
  margin-top: 0.3rem;
}

.difficulty-easy {
  background: #4caf50;
  color: white;
}

.difficulty-normal {
  background: #ff9800;
  color: white;
}

.difficulty-hard {
  background: #f44336;
  color: white;
}

.carousel-btn {
  background: rgba(255,255,255,0.7);
  border: 2px solid var(--gold);
  color: var(--gold);
  font-size: 2.5rem;
  width: 150px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding-bottom: 4px;
}

.carousel-prev::before {
  content: '‹';
  animation: arrow-left 0.4s ease-in-out 3;
}

.carousel-next::after {
  content: '›';
  animation: arrow-right 0.4s ease-in-out 3;
}

@keyframes arrow-left {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-5px); }
}

@keyframes arrow-right {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(5px); }
}

.carousel-btn:hover {
  background: var(--gold);
  color: var(--bg-dark);
}

.carousel-btn:active {
  transform: scale(0.95);
}

.carousel-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin: 0.5rem 0 1.5rem;
}

.carousel-counter {
  font-family: var(--font-main);
  font-size: 1.2rem;
  color: var(--text-light);
  min-width: 60px;
  text-align: center;
}

/* Desktop carousel */
@media (min-width: 769px) {
  .carousel-track {
    width: 60vw;
    max-width: 550px;
  }
}

/* Game Exit */
.game-exit {
  position: relative;
}

.exit-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  z-index: 100;
  transition: color 0.2s;
}

.exit-link:hover {
  color: var(--gold);
}

/* Confirm Modal */
.confirm-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.confirm-modal.active {
  display: flex;
}

.confirm-modal-content {
  background: linear-gradient(135deg, #f5f0e1 0%, #e8e0c8 100%);
  border: 4px solid var(--gold);
  border-radius: 12px;
  padding: 2rem 3rem;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.confirm-message {
  font-family: var(--font-brush);
  font-size: 1.4rem;
  color: var(--text-dark);
  margin-bottom: 1.5rem;
}

.confirm-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.confirm-buttons .btn {
  min-width: 80px;
}

.btn-cancel {
  background: linear-gradient(to bottom, #888 0%, #666 100%);
}

.btn-cancel:hover {
  background: linear-gradient(to bottom, #777 0%, #555 100%);
}

/* Start Modal */
.start-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.start-modal.active {
  display: flex;
}

.start-modal-content {
  background: rgba(0, 0, 0, 0.85);
  border: 3px solid var(--gold);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.start-modal-content h2 {
  font-family: var(--font-brush);
  font-size: 1.8rem;
  color: var(--gold);
  text-align: center;
  margin-bottom: 1rem;
}

.start-modal-content ol {
  padding-left: 1.5rem;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.start-modal-content ol li {
  margin-bottom: 0.4rem;
}

.start-modal-content ol li::marker {
  color: #e91e63;
  font-weight: bold;
}

.start-modal-content .start-btn {
  display: block;
  width: 100%;
  text-align: center;
  margin-bottom: 1.5rem;
}

.start-modal-content .member-benefits {
  margin-top: 0;
  border-top: 1px solid var(--card-border);
  padding-top: 1rem;
}

.start-modal-content .member-benefits h3 {
  font-family: var(--font-brush);
  font-size: 1.3rem;
  color: var(--gold);
  text-align: center;
  margin-bottom: 0.5rem;
}

.start-modal-content .member-benefits ul {
  padding-left: 1.5rem;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.start-modal-content .register-cta {
  text-align: center;
}

/* Game Board */
.game-board {
  max-width: 1080px;
  margin: 0 auto;
}

.round-info {
  font-family: var(--font-brush);
  text-align: center;
  color: var(--gold);
  margin-bottom: 0.3rem;
  font-size: 1.2rem;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.parent-card {
  background: linear-gradient(135deg, #f5f0e1 0%, #e8e0c8 100%);
  border: 4px solid var(--gold);
  border-radius: 8px;
  padding: 0.8rem 2rem;
  text-align: center;
  margin-bottom: 1rem;
  box-shadow:
    0 4px 12px rgba(0,0,0,0.3),
    inset 0 0 30px rgba(212,175,55,0.1);
  position: relative;
  overflow: hidden;
}

.parent-card-cpu {
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  height: 120%;
  width: auto;
  opacity: 0.4;
  z-index: 0;
  pointer-events: none;
}

.parent-card::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  bottom: 6px;
  border: 2px solid rgba(212,175,55,0.4);
  border-radius: 4px;
  pointer-events: none;
}

.card-label {
  font-family: var(--font-brush);
  font-size: 1.4rem;
  color: var(--card-border);
  margin-bottom: 0.3rem;
  position: relative;
  z-index: 1;
}

.card-name {
  font-family: var(--font-brush);
  font-size: 1.6rem;
  color: var(--text-dark);
  letter-spacing: 0.1em;
  position: relative;
  z-index: 1;
}

/* Compact parent card for round result */
.parent-card-wrapper {
  position: relative;
  margin-bottom: 0.5rem;
  z-index: 1;
}

.parent-card-compact {
  padding: 0.4rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.parent-card-compact::before {
  display: none;
}

.card-label-inline {
  font-family: var(--font-brush);
  font-size: 1.1rem;
  color: var(--card-border);
}

.card-name-inline {
  font-family: var(--font-brush);
  font-size: 1.3rem;
  color: var(--text-dark);
  letter-spacing: 0.05em;
}

.result-cpu-image {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 480px;
  height: 480px;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

.hand-section {
  margin-bottom: 2rem;
}

.hand-instruction {
  font-family: var(--font-main);
  text-align: center;
  color: var(--text);
  margin: 0;
  font-size: 1.1rem;
}

.hand {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  max-width: 648px;
  margin: 0 auto;
}

.card {
  background: linear-gradient(135deg, #f5f0e1 0%, #e8e0c8 100%);
  border: 3px solid var(--card-border);
  border-radius: 8px;
  padding: 1rem 0.5rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  box-shadow:
    2px 2px 4px rgba(0,0,0,0.3),
    inset 0 0 20px rgba(139,115,85,0.1);
}

.card::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  border: 1px solid rgba(139,115,85,0.3);
  border-radius: 3px;
  pointer-events: none;
}

.card input {
  display: none;
}

.card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.card.selected {
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px var(--accent),
    0 8px 16px rgba(196,30,58,0.3);
  background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
}

.selection-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--accent);
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: bold;
  border: 2px solid var(--gold);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  z-index: 10;
}

.card-content {
  font-family: var(--font-brush);
  writing-mode: vertical-rl;
  text-orientation: upright;
  color: var(--text-dark);
  font-size: 1.3rem;
  line-height: 1.4;
  letter-spacing: 0.15em;
  text-align: center;
}

.submit-form {
  text-align: center;
}

/* Round Result */
.round-result {
  text-align: center;
  max-width: 1080px;
  margin: 0 auto;
  position: relative;
  padding-top: 180px;
}

.result-display {
  font-family: var(--font-brush);
  font-size: 3.5rem;
  margin-bottom: 0.2rem;
  text-shadow:
    -1px -1px 0 #fff,
    1px -1px 0 #fff,
    -1px 1px 0 #fff,
    1px 1px 0 #fff,
    0 0 10px rgba(0,0,0,0.8),
    0 0 20px rgba(0,0,0,0.6);
  letter-spacing: 0.2em;
  position: relative;
  z-index: 2;
}

.result-display.win { color: var(--win); }
.result-display.lose { color: var(--lose); }
.result-display.draw { color: var(--draw); }

.cards-display {
  display: flex;
  justify-content: space-around;
  margin-bottom: 2rem;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.player-cards,
.cpu-cards {
  flex: 1;
}

.player-cards h3,
.cpu-cards h3 {
  font-family: var(--font-brush);
  font-size: 1.1rem;
  color: var(--gold);
  margin-bottom: 1rem;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.cards-display .card {
  cursor: default;
  margin-bottom: 0.5rem;
}

.phrase {
  background: linear-gradient(135deg, #f5f0e1 0%, #e8e0c8 100%);
  border: 3px solid var(--card-border);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  margin-top: 0.5rem;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.phrase .word {
  display: block;
  font-family: var(--font-brush);
  color: var(--text-dark);
  font-size: clamp(0.5rem, 3.5vw, 1.32rem);
  letter-spacing: 0.05em;
  margin-bottom: 0.1rem;
  white-space: nowrap;
}

.phrase .word:last-child {
  margin-bottom: 0;
}

.score-display {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
  font-family: var(--font-brush);
  font-size: 1.65rem;
  background: linear-gradient(135deg, #f5f0e1 0%, #e8e0c8 100%);
  border-radius: 8px;
  padding: 0.4rem 1.5rem;
  box-shadow:
    0 4px 8px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.5);
  max-width: 672px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
}

.round-result .btn {
  position: relative;
  z-index: 1;
}

.score-display .wins { color: var(--win); text-shadow: 1px 1px 2px rgba(0,0,0,0.3); }
.score-display .losses { color: var(--lose); text-shadow: 1px 1px 2px rgba(0,0,0,0.3); }
.score-display .draws { color: var(--draw); text-shadow: 1px 1px 2px rgba(0,0,0,0.3); }

/* Final Result */
.final-result {
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
  padding-top: 180px;
}

.result-banner {
  font-family: var(--font-brush);
  font-size: 4rem;
  margin-bottom: 0.2rem;
  text-shadow:
    -1px -1px 0 #fff,
    1px -1px 0 #fff,
    -1px 1px 0 #fff,
    1px 1px 0 #fff,
    0 0 10px rgba(0,0,0,0.8),
    0 0 20px rgba(0,0,0,0.6);
  letter-spacing: 0.3em;
  position: relative;
  z-index: 2;
}

.result-banner.win {
  color: #ff4444;
}

.result-banner.lose {
  color: #4a0080;
  position: relative;
  display: inline-block;
  animation: appear 2s ease-out forwards;
}

@keyframes appear {
  0% {
    filter: blur(4px) drop-shadow(0 15px 30px rgba(74, 0, 128, 0.1));
    opacity: 0;
  }
  30% {
    filter: blur(3px) drop-shadow(0 10px 20px rgba(74, 0, 128, 0.2));
    opacity: 0.3;
  }
  60% {
    filter: blur(1px) drop-shadow(0 5px 10px rgba(74, 0, 128, 0.4));
    opacity: 0.7;
  }
  100% {
    filter: blur(0px) drop-shadow(0 0 5px rgba(74, 0, 128, 0.5));
    opacity: 1;
  }
}
.result-banner.draw { color: var(--draw); }

.final-score {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, #f5f0e1 0%, #e8e0c8 100%);
  border-radius: 8px;
  padding: 1rem 2rem;
  box-shadow:
    0 4px 8px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.5);
  position: relative;
  z-index: 1;
}

.final-result .parent-card {
  position: relative;
  z-index: 1;
}

.final-result .actions {
  position: relative;
  z-index: 1;
}

.score-item {
  text-align: center;
}

.score-item .label {
  font-family: var(--font-main);
  display: block;
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.score-item .value {
  font-family: var(--font-brush);
  font-size: 2.5rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.score-item.wins .value { color: var(--win); }
.score-item.draws .value { color: var(--draw); }
.score-item.losses .value { color: var(--lose); }

.actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* Import */
.import-page {
  max-width: 700px;
  margin: 0 auto;
  background: rgba(0, 0, 0, 0.7);
  padding: 2rem;
  border-radius: 12px;
}

.import-page h1 {
  text-align: center;
  color: var(--gold);
  margin-bottom: 1.5rem;
}

.existing-pack-notice {
  background: rgba(212, 175, 55, 0.2);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.existing-pack-notice .notice-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.tab-buttons {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tab-btn {
  flex: 1;
  padding: 0.8rem 1rem;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: #1a1a2e;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--gold);
  color: #1a1a2e;
  border-color: var(--gold);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.form-section {
  margin-bottom: 2rem;
}

.form-section h3 {
  color: var(--gold);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.form-section .max-notice {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.card-counter,
.chip-counter {
  font-size: 0.9rem;
  color: var(--gold);
  margin-left: 0.5rem;
  font-weight: normal;
}

/* Chip Form */
.chip-input-wrapper {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.chip-input-wrapper .input-field {
  flex: 1;
}

.btn-add-chip {
  background: var(--gold);
  color: #1a1a2e;
  border: none;
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  white-space: nowrap;
  font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Meiryo', sans-serif;
}

.btn-add-chip:hover {
  background: #b8960b;
}

.chip-list-wrapper {
  margin-top: 0.5rem;
}

.chip-list-wrapper.collapsed .chip-list {
  display: none;
}

.chip-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.3rem 0;
  font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Meiryo', sans-serif;
}

.chip-toggle:hover {
  color: var(--gold);
}

.toggle-icon {
  display: inline-block;
  width: 1em;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(212, 175, 55, 0.2);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Meiryo', sans-serif;
}

.chip-text {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-remove {
  background: none;
  border: none;
  color: var(--gold);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0;
  opacity: 0.7;
}

.chip-remove:hover {
  opacity: 1;
}

.form-actions {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-top: 2rem;
}

.form-actions .btn {
  white-space: nowrap;
  font-size: clamp(0.75rem, 3vw, 1rem);
  padding: 0.6rem 0.8rem;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.form-section .hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.input-field {
  width: 100%;
  padding: 0.8rem 1rem;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: #1a1a2e;
  font-size: 1rem;
}

.input-field:focus {
  outline: none;
  border-color: var(--gold);
}

.input-field::placeholder {
  color: #888;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.card-input {
  display: flex;
  gap: 0.5rem;
}

.btn-add {
  background: transparent;
  border: 1px dashed var(--gold);
  color: var(--gold);
}

.btn-add:hover {
  background: rgba(212, 175, 55, 0.2);
}

.btn-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.file-input {
  width: 100%;
  padding: 1rem;
  background: #fff;
  border: 1px dashed var(--card-border);
  border-radius: 8px;
  color: #1a1a2e;
}

.format-guide {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 2rem;
}

.format-guide h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--gold);
}

.format-guide pre {
  background: var(--bg-color);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.85rem;
}

.import-form .field {
  margin-bottom: 1rem;
}

.import-form label {
  display: block;
  margin-bottom: 0.5rem;
}

/* Mypage */
.mypage {
  max-width: 600px;
  margin: 0 auto;
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 12px;
  color: #1a1a2e;
}

.mypage h1 {
  margin-bottom: 2rem;
  text-align: center;
  color: #5a3d2b;
}

.stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 2rem;
  background: rgba(139, 90, 43, 0.15);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--card-border);
}

.stat-item {
  text-align: center;
}

.stat-item .label {
  display: block;
  font-size: 0.9rem;
  color: #666;
}

.stat-item .value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #8b5a2b;
}

.mypage-actions {
  margin-bottom: 2rem;
  text-align: center;
}

.btn-theme-create {
  display: inline-block;
  background: #c9a227;
  color: #1a1a2e;
  padding: 1rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1rem;
  font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Meiryo', sans-serif;
  transition: background 0.2s;
}

.btn-theme-create:hover {
  background: #a8871f;
}

.mypage h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: #5a3d2b;
}

.records {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.record-item {
  background: var(--card-bg);
  color: #1a1a2e;
  padding: 0.8rem 1rem;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 3px solid var(--card-border);
}

.record-item.win { border-left-color: var(--win); }
.record-item.lose { border-left-color: var(--lose); }
.record-item.draw { border-left-color: var(--draw); }

.record-item .theme {
  font-weight: bold;
}

.record-item .difficulty {
  font-size: 0.9rem;
  color: #666;
}

.record-item .result {
  font-weight: bold;
}

.record-item .date {
  font-size: 0.9rem;
  color: #666;
}

/* Admin */
.admin-body {
  background: #f5f5f5;
  color: #333;
}

.admin-header {
  background: #333;
  color: white;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header .logo {
  color: white;
}

.admin-header nav {
  display: flex;
  gap: 1rem;
}

.admin-header nav a {
  color: white;
  text-decoration: none;
}

.admin-main {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.admin-users h1,
.admin-settings h1 {
  margin-bottom: 1rem;
}

.users-table {
  width: 100%;
  background: white;
  border-collapse: collapse;
}

.users-table th,
.users-table td {
  padding: 0.8rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.users-table th {
  background: #f0f0f0;
}

.admin-settings .field {
  margin-bottom: 1rem;
}

.admin-settings label {
  display: block;
  margin-bottom: 0.3rem;
}

.admin-settings input[type="number"] {
  padding: 0.5rem;
  width: 100px;
}

/* Devise forms */
.devise-form {
  max-width: 400px;
  margin: 0 auto;
  background: linear-gradient(135deg, rgba(61,37,24,0.9), rgba(45,27,20,0.95));
  padding: 2.5rem;
  border-radius: 12px;
  border: 3px solid var(--gold);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.devise-form h2 {
  font-family: var(--font-brush);
  text-align: center;
  margin-bottom: 2rem;
  color: var(--gold);
  font-size: 2rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.devise-form .field {
  margin-bottom: 1.2rem;
}

.devise-form label {
  font-family: var(--font-main);
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 1rem;
}

.devise-form .hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.devise-form input[type="email"],
.devise-form input[type="password"],
.devise-form input[type="text"] {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 2px solid var(--card-border);
  border-radius: 6px;
  background: linear-gradient(135deg, #f5f0e1, #e8e0c8);
  color: var(--text-dark);
  font-family: var(--font-main);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.devise-form input[type="email"]:focus,
.devise-form input[type="password"]:focus,
.devise-form input[type="text"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.3);
}

.devise-form input::placeholder {
  color: #999;
}

.devise-form .field.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.devise-form .field.checkbox input {
  width: auto;
}

.devise-form .field.checkbox label {
  display: inline;
  margin-bottom: 0;
}

.devise-form .actions {
  margin-top: 2rem;
  text-align: center;
}

.devise-form .actions .btn {
  padding-left: 1.2rem;
  padding-right: 1.2rem;
}

.devise-form .links {
  margin-top: 1.5rem;
  text-align: center;
}

.devise-form .links a {
  font-family: var(--font-main);
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.devise-form .links a:hover {
  color: var(--gold);
}

.devise-form #error_explanation {
  background: rgba(196,30,58,0.2);
  border: 2px solid var(--accent);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.devise-form #error_explanation h2 {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.devise-form #error_explanation ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text);
}

.danger-zone {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(196,30,58,0.3);
}

.danger-zone h3 {
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.danger-zone p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.btn-danger {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-main);
}

.btn-danger:hover {
  background: #a01830;
}

/* PC・タブレット向けレスポンシブ */
@media (min-width: 768px) {
  /* Theme grid 2x2 on desktop */
  .theme-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 700px;
    margin: 0 auto 2rem;
  }

  .theme-card {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .hand {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    max-width: 860px;
    margin: 0 auto;
  }

  .hand .card {
    width: 160px;
    aspect-ratio: 5 / 7.2;
    padding: 0.6rem 0.4rem;
  }

  .hand .card .card-content {
    font-size: 1.1rem;
  }
}


/* Sound warning */
.sound-warning {
  text-align: center;
  color: #fff;
  font-size: 0.9rem;
  margin: 1.5rem auto 0;
  background: rgba(255, 100, 100, 0.85);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  display: block;
  width: fit-content;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Sound toggle button */
.sound-toggle {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: background 0.2s;
}

.sound-toggle:hover {
  background: var(--bg-color);
}

.sound-toggle svg {
  width: 24px;
  height: 24px;
  fill: var(--text);
}

.sound-toggle.muted svg.icon-sound-on,
.sound-toggle:not(.muted) svg.icon-sound-off {
  display: none;
}

.sound-toggle.muted svg.icon-sound-off,
.sound-toggle:not(.muted) svg.icon-sound-on {
  display: block;
}

/* ========================================
   Hukyu Quiz Styles
   ======================================== */
.hukyu-quiz {
  font-family: 'Noto Serif JP', serif;
  background: linear-gradient(135deg, #0d1f1a 0%, #1a3a2f 30%, #0f2922 70%, #0a1915 100%);
  min-height: 100vh;
  color: #e8f5e9;
  position: relative;
  overflow-x: hidden;
}

.hukyu-quiz::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(0, 100, 80, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(0, 150, 136, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(38, 166, 154, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Password Modal */
.hukyu-password-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.hukyu-password-box {
  background: linear-gradient(135deg, #1a2f1a 0%, #0d1f0d 100%);
  border: 1px solid rgba(129, 199, 132, 0.3);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  max-width: 320px;
}

.hukyu-password-box p {
  color: #c8e6c9;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.hukyu-password-input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(129, 199, 132, 0.4);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: #e8f5e9;
  font-size: 1rem;
  margin-bottom: 1rem;
  box-sizing: border-box;
}

.hukyu-password-input::placeholder {
  color: rgba(200, 230, 201, 0.5);
}

.hukyu-password-input:focus {
  outline: none;
  border-color: #81c784;
}

.hukyu-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

/* Particles */
.hukyu-particles {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  bottom: -20px;
  width: 4px;
  height: 4px;
  background: rgba(129, 199, 132, 0.6);
  border-radius: 50%;
  animation: float-up linear infinite;
  box-shadow: 0 0 6px rgba(129, 199, 132, 0.4);
}

@keyframes float-up {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) rotate(360deg);
    opacity: 0;
  }
}

/* Top Page */
.hukyu-top {
  text-align: center;
  max-width: 600px;
}

.hukyu-logo {
  margin-bottom: 2rem;
}

.hukyu-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3.5rem;
  font-weight: 600;
  font-style: italic;
  color: #a5d6a7;
  text-shadow: 0 0 30px rgba(129, 199, 132, 0.5), 0 2px 4px rgba(0, 0, 0, 0.5);
  margin: 0;
  letter-spacing: 0.05em;
}

.hukyu-subtitle {
  font-size: 1.3rem;
  color: #80cbc4;
  margin-top: 0.5rem;
  letter-spacing: 0.3em;
}

.hukyu-description {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
}

.hukyu-description p {
  margin: 0.3rem 0;
  font-size: 1.05rem;
  line-height: 1.8;
}

.hukyu-welcome {
  font-size: 2.2rem !important;
  font-weight: 700;
  color: #66bb6a;
  position: relative;
  display: inline-block;
  background: linear-gradient(
    90deg,
    #66bb6a 0%,
    #66bb6a 45%,
    #ffffff 50%,
    #66bb6a 55%,
    #66bb6a 100%
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: hukyu-shine 4s linear infinite;
}

@keyframes hukyu-shine {
  0% {
    background-position: 100% center;
  }
  50% {
    background-position: 0% center;
  }
  50.1%, 100% {
    background-position: 100% center;
  }
}

/* Buttons */
.hukyu-btn {
  font-family: 'Noto Serif JP', serif;
  display: inline-block;
  padding: 1rem 2.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.hukyu-btn-primary {
  background: linear-gradient(135deg, #26a69a 0%, #00897b 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(38, 166, 154, 0.4);
}

.hukyu-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(38, 166, 154, 0.6);
}

.hukyu-sound-note {
  font-size: 0.75rem;
  color: rgba(200, 230, 201, 0.6);
  margin-top: 0.5rem;
}

.hukyu-btn-secondary {
  background: transparent;
  color: #80cbc4;
  border: 1px solid #80cbc4;
}

.hukyu-btn-secondary:hover {
  background: rgba(128, 203, 196, 0.1);
}

.hukyu-btn-small {
  padding: 0.6rem 1.5rem;
  font-size: 1rem;
}

.hukyu-btn-twitter {
  background: #000;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.hukyu-btn-twitter:hover {
  background: #333;
}

.hukyu-twitter-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.hukyu-btn-gold {
  background: linear-gradient(135deg, #c9a227 0%, #a8871f 100%);
  color: #1a1a2e;
}

.hukyu-btn-gold:hover {
  box-shadow: 0 4px 15px rgba(201, 162, 39, 0.4);
}

.hukyu-book-link {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hukyu-book-link p {
  font-size: 0.95rem;
  color: #80cbc4;
  margin-bottom: 1rem;
}

/* Quiz Screen */
.hukyu-quiz-screen {
  width: 100%;
  max-width: 700px;
}

.hukyu-progress {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.hukyu-progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.hukyu-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #26a69a, #4db6ac);
  transition: width 0.3s ease;
}

.hukyu-progress-text {
  font-size: 0.95rem;
  color: #80cbc4;
  min-width: 60px;
  text-align: right;
}

.hukyu-question-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 2rem;
  transition: opacity 0.3s ease;
}

.hukyu-question-card.answered {
  opacity: 0.6;
  pointer-events: none;
}

.hukyu-question-number {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #4db6ac;
  margin-bottom: 1rem;
}

.hukyu-question-text {
  font-size: 1.2rem;
  line-height: 1.8;
  margin-bottom: 2rem;
}

/* Choice buttons */
.hukyu-choices {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.hukyu-choice-btn {
  font-family: 'Noto Serif JP', serif;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e8f5e9;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.hukyu-choice-btn:hover {
  background: rgba(38, 166, 154, 0.2);
  border-color: #26a69a;
}

/* Fill input */
.hukyu-fill {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.hukyu-fill-input {
  flex: 1;
  font-family: 'Noto Serif JP', serif;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #e8f5e9;
  padding: 1rem;
  border-radius: 8px;
  font-size: 1.1rem;
}

.hukyu-fill-input::placeholder {
  color: rgba(232, 245, 233, 0.5);
}

.hukyu-fill-input:focus {
  outline: none;
  border-color: #26a69a;
  box-shadow: 0 0 0 3px rgba(38, 166, 154, 0.2);
}

/* Image choices */
.hukyu-image-choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.hukyu-image-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hukyu-image-btn:hover {
  border-color: #26a69a;
}

.hukyu-image-placeholder {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  font-size: 2rem;
  color: #80cbc4;
}

.hukyu-image-label {
  display: block;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: #80cbc4;
  margin-bottom: 0.5rem;
}

.hukyu-image-choice {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

/* Feedback */
.hukyu-feedback {
  margin-top: 1.5rem;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.hukyu-feedback.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.hukyu-feedback-icon {
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.hukyu-feedback-icon.correct {
  color: #4caf50;
  text-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
}

.hukyu-feedback-icon.incorrect {
  color: #ef5350;
  text-shadow: 0 0 20px rgba(239, 83, 80, 0.5);
}

.hukyu-feedback-text {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

/* Result Page */
.hukyu-result {
  width: 100%;
  max-width: 500px;
}

.hukyu-result-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 2.5rem;
  text-align: center;
}

.hukyu-result-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  font-weight: 600;
  color: #a5d6a7;
  margin: 0 0 0.3rem;
}

.hukyu-result-score {
  margin-bottom: 1.5rem;
}

.hukyu-score-number {
  font-family: 'Cormorant Garamond', serif;
  font-size: 5rem;
  font-weight: 600;
  color: #4db6ac;
  text-shadow: 0 0 30px rgba(77, 182, 172, 0.5);
}

.hukyu-score-total {
  font-size: 2rem;
  color: #80cbc4;
}

.hukyu-result-rank {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.hukyu-rank-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #c9a227;
  margin-bottom: 0.5rem;
}

.hukyu-rank-message {
  font-size: 1rem;
  color: #b0bec5;
}

.hukyu-result-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.hukyu-book-promo {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hukyu-book-promo p {
  font-size: 0.95rem;
  color: #80cbc4;
  margin-bottom: 1rem;
}

/* Intro Animation */
.hukyu-intro {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  z-index: 100;
  overflow: hidden;
}

.hukyu-intro.fade-out {
  opacity: 0;
}

.hukyu-intro-character {
  position: relative;
  perspective: 1000px;
}

.hukyu-intro-img {
  height: 80vh;
  width: auto !important;
  aspect-ratio: 500 / 707;
  opacity: 0;
  transform-style: preserve-3d;
  transform-origin: top center;
}

.hukyu-intro-img.animate {
  animation: intro-cylinder 3s ease-in-out forwards;
}

@keyframes intro-cylinder {
  0% {
    opacity: 0;
    transform: translateX(-60vw) translateY(0) rotateY(-70deg) scale(0.3);
  }
  10% {
    opacity: 1;
  }
  40% {
    opacity: 1;
    transform: translateX(0) translateY(0) rotateY(0deg) scale(1.5);
  }
  70% {
    opacity: 1;
    transform: translateX(0) translateY(0) rotateY(0deg) scale(1.5);
  }
  100% {
    opacity: 0;
    transform: translateX(0) translateY(0) rotateY(0deg) scale(1.5);
  }
}

.hukyu-intro-text {
  position: absolute;
  top: 60vh;
  left: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(77, 182, 172, 0.3);
}

.hukyu-intro-text.animate {
  animation: text-appear 2s ease-in-out forwards;
}

@keyframes text-appear {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  20% {
    opacity: 1;
    transform: translateY(0);
  }
  70% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(0);
  }
}

.hukyu-intro-q {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.5rem;
  font-weight: 600;
  color: #4db6ac;
  text-shadow: 0 0 20px rgba(77, 182, 172, 0.5);
}

.hukyu-intro-message {
  font-size: 1.5rem;
  color: #e8f5e9;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Hukyu Correct Effect */
.hukyu-correct-effect {
  position: fixed;
  bottom: 10vh;
  left: 0;
  right: 0;
  height: 60vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  z-index: 50;
  opacity: 0;
  transform: translateY(100%);
  transition: none;
}

.hukyu-correct-effect.show {
  animation: correct-slide-up 0.5s ease-out forwards;
}

.hukyu-correct-effect.hide {
  animation: correct-fade-out 0.3s ease-out forwards;
}

@keyframes correct-slide-up {
  0% {
    opacity: 0;
    transform: translateY(100%);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes correct-fade-out {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(0);
  }
}

.hukyu-correct-img {
  height: 100%;
  width: auto;
  object-fit: contain;
  object-position: top center;
  transform: scale(1.5);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 50%, transparent 60%);
  mask-image: linear-gradient(to bottom, black 0%, black 50%, transparent 60%);
}

.hukyu-correct-text {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%) rotate(-15deg);
  font-family: 'Yuji Syuku', serif;
  font-size: clamp(3rem, 12vw, 6rem);
  color: #4ade80;
  text-shadow:
    3px 3px 0 #166534,
    -1px -1px 0 #166534,
    1px -1px 0 #166534,
    -1px 1px 0 #166534,
    0 0 30px rgba(74, 222, 128, 0.8),
    0 0 60px rgba(74, 222, 128, 0.5);
  white-space: nowrap;
  z-index: 60;
  letter-spacing: 0.1em;
}

/* Hukyu Sound Toggle */
.hukyu-sound-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(77, 182, 172, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: all 0.2s;
}

.hukyu-sound-toggle:hover {
  background: rgba(0, 0, 0, 0.8);
  border-color: #4db6ac;
}

.hukyu-sound-toggle svg {
  width: 24px;
  height: 24px;
  color: #4db6ac;
}

.hukyu-sound-toggle .icon-sound-off {
  display: none;
}

.hukyu-sound-toggle.muted .icon-sound-on {
  display: none;
}

.hukyu-sound-toggle.muted .icon-sound-off {
  display: block;
  color: #ef5350;
}

/* Responsive */
@media (max-width: 600px) {
  .hukyu-title {
    font-size: 2.5rem;
  }

  .hukyu-question-card {
    padding: 1.5rem;
  }

  .hukyu-image-choices {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }

  .hukyu-fill {
    flex-direction: column;
  }

  .hukyu-fill .hukyu-btn-small {
    width: 100%;
  }

  .hukyu-intro-img {
    width: 120px;
  }

  .hukyu-intro-q {
    font-size: 2rem;
  }

  .hukyu-intro-message {
    font-size: 1.2rem;
  }
}

/* ====================================
   Blackjack Styles
   ==================================== */

.blackjack-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* タイトル画面 */
.blackjack-title-screen {
  background: rgba(0, 0, 0, 0.5);
}

.blackjack-fade-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 100;
  pointer-events: none;
  animation: blackjack-fade-in 1.5s ease-out forwards;
}

@keyframes blackjack-fade-in {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.blackjack-title {
  font-family: 'Georgia', serif;
  font-size: clamp(2rem, 8vw, 5rem);
  color: #FFD700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 2px 2px 4px #000;
  letter-spacing: 0.2em;
  margin-bottom: 2rem;
}

.blackjack-title-img {
  max-width: 80%;
  width: auto;
  height: auto;
  margin-bottom: 2rem;
  filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
}

.blackjack-menu {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* スタートボタン（テキストのみ） */
.blackjack-start-btn {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.1em;
  padding: 0.5em 1em;
  cursor: pointer;
  transition: transform 0.2s, text-shadow 0.2s;
  text-shadow:
    2px 2px 0 #000,
    -2px 2px 0 #000,
    2px -2px 0 #000,
    -2px -2px 0 #000,
    0 2px 0 #000,
    0 -2px 0 #000,
    2px 0 0 #000,
    -2px 0 0 #000,
    0 0 15px rgba(255, 255, 255, 0.8),
    0 0 30px rgba(255, 255, 255, 0.5),
    0 0 45px rgba(255, 255, 255, 0.3);
}

.blackjack-start-btn:hover {
  transform: scale(1.05);
  text-shadow:
    2px 2px 0 #000,
    -2px 2px 0 #000,
    2px -2px 0 #000,
    -2px -2px 0 #000,
    0 2px 0 #000,
    0 -2px 0 #000,
    2px 0 0 #000,
    -2px 0 0 #000,
    0 0 20px rgba(255, 255, 255, 1),
    0 0 40px rgba(255, 255, 255, 0.7),
    0 0 60px rgba(255, 255, 255, 0.4);
}

.blackjack-start-btn:active {
  transform: scale(0.95);
}

/* BGMトグルボタン */
.bgm-toggle {
  position: fixed;
  top: 2%;
  right: calc(2% + 60px);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.bgm-toggle:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.bgm-toggle:active {
  transform: scale(0.95);
}

/* BGM注意書き */
.bgm-notice {
  color: rgba(255, 255, 255, 0.85);
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  margin-top: 2rem;
  text-align: center;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
}

/* キャラ選択画面 */
.blackjack-select-screen {
  background: rgba(0, 0, 0, 0.7);
  justify-content: space-around;
  padding: 3% 2%;
  overflow: hidden;
}

@media (max-width: 768px) {
  .blackjack-select-screen {
    padding: 5% 0;
    justify-content: space-evenly;
  }
}

.fantasy-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 6px #fff, 0 0 10px #FFD700;
  animation: sparkle-float 4s ease-in-out infinite;
}

@keyframes sparkle-float {
  0%, 100% {
    opacity: 0;
    transform: translateY(0) scale(0);
  }
  10% {
    opacity: 1;
    transform: translateY(-10px) scale(1);
  }
  90% {
    opacity: 1;
    transform: translateY(-80px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-100px) scale(0);
  }
}

.character-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.section-label {
  color: #FFD700;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  font-weight: bold;
  text-shadow: 1px 1px 2px #000;
  letter-spacing: 0.1em;
}

@media (max-width: 768px) {
  .section-label {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
  }
}

.character-list {
  display: flex;
  gap: clamp(0.3rem, 1vw, 0.8rem);
  justify-content: center;
}

/* スクロール矢印（デフォルト非表示） */
.scroll-arrow {
  display: none;
}

/* スマホ用横スクロール */
@media (max-width: 768px) {
  .character-section {
    width: 100%;
    position: relative;
    overflow: visible;
    align-items: center;
  }

  .character-list {
    display: flex;
    justify-content: flex-start;
    overflow-x: scroll;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    padding: 25px 10px;
    gap: 20px;
    width: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .character-list::-webkit-scrollbar {
    display: none;
  }

  /* スクロール矢印 */
  .scroll-arrow {
    display: flex;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    pointer-events: none;
    z-index: 10;
  }

  .scroll-arrow-left {
    left: 5px;
  }

  .scroll-arrow-right {
    right: 5px;
  }
}

.character-slot {
  position: relative;
  width: clamp(80px, 15vw, 120px);
  aspect-ratio: 1;
  height: auto;
  border-radius: 50%;
  cursor: pointer;
  overflow: visible;
  flex-shrink: 0;
}

/* スマホ用大きいキャラ画像 */
@media (max-width: 768px) {
  .character-slot {
    width: clamp(100px, 28vw, 140px);
    scroll-snap-align: center;
    scroll-snap-stop: always;
  }
}

.character-slot::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  background: linear-gradient(45deg,
    #ff00ff, #00ffff, #ffff00, #ff00ff, #00ffff);
  background-size: 300% 300%;
  animation: sparkle-border 3s linear infinite;
  z-index: -1;
  opacity: 0.7;
}

.character-slot::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  box-shadow:
    inset 0 0 15px rgba(255, 255, 255, 0.4),
    0 0 8px rgba(255, 255, 255, 0.3);
  pointer-events: none;
  z-index: 2;
}

@keyframes sparkle-border {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.character-slot:hover::before {
  opacity: 1;
  filter: brightness(1.3);
}

.character-slot.selected {
}

.character-slot.unselected {
  filter: grayscale(100%) brightness(0.5);
}

.character-slot.unselected::before {
  opacity: 0.3;
}

.character-slot.unselected:hover {
  filter: grayscale(50%) brightness(0.7);
}

.character-slot.selected::before {
  opacity: 1;
  background: linear-gradient(45deg,
    #FFD700, #FFF, #FFD700, #FFF, #FFD700);
  background-size: 300% 300%;
  animation: sparkle-border 1s linear infinite;
  filter: brightness(1.2);
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.9);
}

.character-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg,
    #1a0033 0%,
    #330066 30%,
    #1a0033 50%,
    #000033 70%,
    #1a0033 100%);
}

.character-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 100, 255, 0.3) 0%, transparent 40%),
    radial-gradient(circle at 70% 70%, rgba(100, 200, 255, 0.2) 0%, transparent 40%);
  animation: bg-pulse 3s ease-in-out infinite;
}

@keyframes bg-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.light-ray {
  position: absolute;
  width: 200%;
  height: 15px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: rotate(-45deg);
  animation: light-ray-move 2s linear infinite;
}

.light-ray:nth-child(1) {
  top: -20%;
  left: -100%;
  animation-delay: 0s;
}

.light-ray:nth-child(2) {
  top: 30%;
  left: -100%;
  animation-delay: 0.7s;
}

.light-ray:nth-child(3) {
  top: 80%;
  left: -100%;
  animation-delay: 1.4s;
}

@keyframes light-ray-move {
  0% {
    transform: rotate(-45deg) translateX(-50%);
  }
  100% {
    transform: rotate(-45deg) translateX(150%);
  }
}

.character-img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  z-index: 1;
}

.select-actions {
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .select-actions {
    margin-top: 1.5rem;
  }

  .select-actions .blackjack-btn {
    font-size: 1.2rem;
    padding: 0.8rem 2rem;
  }
}

/* VS画面 */
.blackjack-vs-screen {
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.vs-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: relative;
}

.vs-character {
  width: 50%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
  z-index: 55;
}

.vs-player {
  animation: vs-slide-left 0.6s ease-out forwards, vs-sway-left 2.5s ease-in-out 0.6s infinite;
}

.vs-enemy {
  animation: vs-slide-right 0.6s ease-out forwards, vs-sway-right 2s ease-in-out 0.9s infinite;
}

@keyframes vs-slide-left {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes vs-slide-right {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes vs-sway-left {
  0%, 100% { transform: translateX(0) translateY(0); }
  50% { transform: translateX(8px) translateY(-10px); }
}

@keyframes vs-sway-right {
  0%, 100% { transform: translateX(0) translateY(0); }
  50% { transform: translateX(-6px) translateY(-12px); }
}

.vs-character img {
  height: 130%;
  width: auto;
  object-fit: cover;
}

.vs-center {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 10%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 60;
}

.vs-center::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 100%;
  background: #fff;
  box-shadow:
    0 0 15px rgba(255, 255, 255, 1),
    0 0 30px rgba(255, 255, 255, 0.8),
    0 0 50px rgba(255, 255, 255, 0.6),
    0 0 80px rgba(255, 255, 255, 0.4);
  z-index: -1;
}

.vs-text {
  font-family: "Yu Mincho", "游明朝", "Hiragino Mincho Pro", serif;
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: bold;
  color: #FFD700;
  text-shadow:
    0 0 10px #FFD700,
    0 0 20px #FFA500,
    0 0 30px #FF4500,
    2px 2px 4px #000;
  z-index: 10;
  animation: vs-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes vs-pulse {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

.vs-light-effect {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.vs-glow-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  filter: blur(30px);
  box-shadow:
    0 0 60px #fff,
    0 0 100px #fff,
    0 0 150px rgba(255,255,255,0.8),
    0 0 200px rgba(255,255,255,0.5);
  animation: glow-pulse 1.5s ease-in-out infinite alternate;
}

.vs-beam {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 100%;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(255,255,255,0.3) 20%,
    rgba(255,255,255,0.8) 45%,
    #fff 50%,
    rgba(255,255,255,0.8) 55%,
    rgba(255,255,255,0.3) 80%,
    transparent 100%
  );
  box-shadow:
    0 0 15px rgba(255,255,255,0.8),
    0 0 30px rgba(100,200,255,0.6);
  animation: beam-flicker 0.5s ease-in-out infinite;
}

.vs-beam:nth-child(2) {
  width: 4px;
  margin-left: -15px;
  opacity: 0.7;
  animation-delay: 0.05s;
}

.vs-beam:nth-child(3) {
  width: 4px;
  margin-left: 15px;
  opacity: 0.7;
  animation-delay: 0.08s;
}

.vs-beam:nth-child(4) {
  width: 3px;
  margin-left: -25px;
  opacity: 0.5;
  animation-delay: 0.03s;
}

@keyframes beam-flicker {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

@keyframes glow-pulse {
  0% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0.7;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.15);
    opacity: 1;
  }
}

/* 放射線エフェクト */
.vs-rays {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  z-index: 50;
  pointer-events: none;
}

.vs-ray {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--width, 3px);
  height: 0;
  background: rgba(180, 180, 180, 0.6);
  transform-origin: top center;
  transform: rotate(var(--angle, 0deg));
  animation: ray-shoot var(--duration, 0.5s) linear forwards;
  box-shadow: 0 0 5px rgba(200, 200, 200, 0.4);
  border-radius: 2px;
}

@keyframes ray-shoot {
  0% {
    height: 0;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  60% {
    height: var(--length, 200px);
    opacity: 1;
  }
  100% {
    height: var(--length, 200px);
    opacity: 0;
  }
}

/* VS画面フラッシュ */
.vs-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, #fff 0%, #fff 60%, rgba(255,255,255,0) 100%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  filter: blur(30px);
  box-shadow: 0 0 80px #fff, 0 0 150px #fff, 0 0 250px rgba(255,255,255,0.8);
}

.vs-flash.active {
  animation: flash-expand 1.8s ease-out forwards;
}

@keyframes flash-expand {
  0% {
    width: 0;
    height: 0;
    opacity: 0.8;
    filter: blur(40px);
  }
  40% {
    width: 200%;
    height: 200%;
    opacity: 1;
    filter: blur(30px);
  }
  70% {
    width: 350%;
    height: 350%;
    opacity: 1;
    filter: blur(15px);
  }
  100% {
    width: 500%;
    height: 500%;
    opacity: 1;
    filter: blur(0px);
  }
}

.blackjack-btn {
  background: linear-gradient(180deg, #444 0%, #222 100%);
  border: 2px solid #666;
  color: #fff;
  padding: 0.8rem 2rem;
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: bold;
  text-decoration: none;
  text-align: center;
}

.blackjack-btn:hover {
  background: linear-gradient(180deg, #555 0%, #333 100%);
  border-color: #888;
  transform: translateY(-2px);
}

.blackjack-btn-primary {
  background: linear-gradient(180deg, #4a7c4e 0%, #2d5a30 100%);
  border-color: #6a9c6e;
}

.blackjack-btn-primary:hover {
  background: linear-gradient(180deg, #5a8c5e 0%, #3d6a40 100%);
  border-color: #7aac7e;
}

/* ゲーム画面 */
.blackjack-game-screen {
  padding: 2% 4%;
  justify-content: center;
  align-items: flex-start;
  gap: 2%;
}

/* デッキ表示 */
.blackjack-deck {
  position: absolute;
  z-index: 20;
}

.blackjack-deck img {
  height: 100%;
  width: auto;
  display: block;
}

.dealer-deck {
  top: 0;
  left: 3%;
  height: 18%;
}

.player-deck {
  bottom: 0;
  left: 3%;
  height: 18%;
}

/* カード配布アニメーション用 */
.dealing-card {
  position: absolute;
  z-index: 25;
  height: 18%;
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-origin: center center;
  filter: brightness(1.2);
}

.dealing-card img {
  height: 100%;
  width: auto;
  display: block;
}

.dealing-card.animate {
  animation: card-fly 0.5s cubic-bezier(0.17, 0.67, 0.29, 1.2) forwards;
}

@keyframes card-fly {
  0% {
    opacity: 0.8;
    filter: brightness(1.5) drop-shadow(0 0 20px rgba(255,255,255,0.8));
  }
  50% {
    opacity: 1;
    filter: brightness(1.3) drop-shadow(0 0 15px rgba(255,255,255,0.6));
  }
  80% {
    filter: brightness(1.1) drop-shadow(0 0 10px rgba(255,255,255,0.4));
  }
  100% {
    opacity: 1;
    filter: brightness(1) drop-shadow(0 0 0 transparent);
  }
}

/* 着地エフェクト */
.card-land-effect {
  position: absolute;
  pointer-events: none;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0) 70%);
  transform: translate(-50%, -50%) scale(0);
  animation: land-burst 0.4s ease-out forwards;
  z-index: 30;
}

@keyframes land-burst {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

/* カード配布アニメーション用 */
.card-dealing {
  position: fixed !important;
  z-index: 1000;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-dealing .card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.card-dealing .card-front,
.card-dealing .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
}

.card-dealing .card-front img,
.card-dealing .card-back img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-dealing .card-front {
  transform: rotateY(180deg);
}

.card-dealing .card-back {
  transform: rotateY(0deg);
}

.card-dealing.flipping .card-inner {
  animation: card-flip 0.4s ease-in-out forwards;
}

@keyframes card-flip {
  0% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(180deg);
  }
}

/* カードめくりアニメーション */
.blackjack-card.card-flipping {
  animation: card-flip-simple 0.2s ease-in-out;
}

@keyframes card-flip-simple {
  0% {
    transform: scaleX(1);
  }
  50% {
    transform: scaleX(0);
  }
  100% {
    transform: scaleX(1);
  }
}

/* アタックアニメーション */
.blackjack-card.attack-animation {
  animation: card-attack 0.5s ease-out forwards;
}

@keyframes card-attack {
  0% {
    transform: translateY(0) scale(1);
  }
  30% {
    transform: translateY(20px) scale(0.9);
  }
  60% {
    transform: translateY(-30px) scale(1.1);
    filter: brightness(1.5) drop-shadow(0 0 20px rgba(255, 50, 50, 0.8));
  }
  100% {
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
}

/* 爆発エフェクト */
.explosion {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 100;
  transform: translate(-50%, -50%) scale(0);
}

.explosion.animate {
  animation: explosion-burst 0.6s ease-out forwards;
}

@keyframes explosion-burst {
  0% {
    transform: translate(-50%, -50%) scale(0);
    background: radial-gradient(circle, rgba(255, 255, 200, 1) 0%, rgba(255, 100, 50, 0.8) 40%, rgba(255, 50, 50, 0) 70%);
    box-shadow: 0 0 60px rgba(255, 100, 50, 1), 0 0 100px rgba(255, 50, 50, 0.8);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.5);
    background: radial-gradient(circle, rgba(255, 200, 100, 0.8) 0%, rgba(255, 50, 50, 0.5) 50%, rgba(255, 50, 50, 0) 70%);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(2);
    background: radial-gradient(circle, rgba(100, 100, 100, 0.3) 0%, rgba(50, 50, 50, 0) 70%);
    box-shadow: none;
    opacity: 0;
  }
}

/* 青い爆発（敵の攻撃時） */
.explosion-blue.animate {
  animation: explosion-burst-blue 0.6s ease-out forwards;
}

@keyframes explosion-burst-blue {
  0% {
    transform: translate(-50%, -50%) scale(0);
    background: radial-gradient(circle, rgba(200, 200, 255, 1) 0%, rgba(50, 100, 255, 0.8) 40%, rgba(50, 50, 255, 0) 70%);
    box-shadow: 0 0 60px rgba(50, 100, 255, 1), 0 0 100px rgba(50, 50, 255, 0.8);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.5);
    background: radial-gradient(circle, rgba(100, 150, 255, 0.8) 0%, rgba(50, 50, 255, 0.5) 50%, rgba(50, 50, 255, 0) 70%);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(2);
    background: radial-gradient(circle, rgba(100, 100, 150, 0.3) 0%, rgba(50, 50, 100, 0) 70%);
    box-shadow: none;
    opacity: 0;
  }
}

/* ドローテキスト */
.draw-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: clamp(3rem, 10vw, 5rem);
  font-weight: bold;
  color: #FFD700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 40px rgba(255, 215, 0, 0.5), 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
}

.draw-text.animate {
  animation: draw-text-show 1.5s ease-out forwards;
}

@keyframes draw-text-show {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  20% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  40% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  80% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
  }
}

/* ダメージ数値表示 */
.damage-number {
  position: absolute;
  transform: translateX(-50%);
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: bold;
  color: #ff3333;
  text-shadow:
    0 0 10px rgba(255, 50, 50, 0.8),
    2px 2px 0 #000,
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
}

.damage-number.animate {
  animation: damage-number-show 1.2s ease-out forwards;
}

@keyframes damage-number-show {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(0) scale(0.5);
  }
  20% {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px) scale(1.2);
  }
  40% {
    transform: translateX(-50%) translateY(-5px) scale(1);
  }
  70% {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px) scale(0.8);
  }
}

.blackjack-dealer-area,
.blackjack-player-area {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 45%;
  width: 66.66%;
  margin-left: 0;
}

.blackjack-dealer-area {
  justify-content: flex-end;
  padding-bottom: 3%;
}

.blackjack-player-area {
  justify-content: flex-start;
  padding-top: 3%;
}

.blackjack-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  height: 80%;
  align-items: center;
}

.blackjack-card {
  height: auto;
  width: 22%;
  position: relative;
}

.blackjack-card img {
  height: auto;
  width: 100%;
  display: block;
}

/* カードのぼかし効果 */
.blackjack-card.glow-rainbow {
  animation: rainbow-glow 2s ease-in-out infinite;
}

@keyframes rainbow-glow {
  0%, 100% { filter: drop-shadow(0 0 5px #ff0000) drop-shadow(0 0 5px #ff8800); }
  25% { filter: drop-shadow(0 0 5px #ffff00) drop-shadow(0 0 5px #00ff00); }
  50% { filter: drop-shadow(0 0 5px #00ffff) drop-shadow(0 0 5px #0088ff); }
  75% { filter: drop-shadow(0 0 5px #8800ff) drop-shadow(0 0 5px #ff00ff); }
}

.blackjack-card.glow-brown {
  animation: brown-glow 1.5s ease-in-out infinite;
}

@keyframes brown-glow {
  0%, 100% { filter: drop-shadow(0 0 4px #8B4513); }
  50% { filter: drop-shadow(0 0 7px #A0522D); }
}

.blackjack-card.glow-silver {
  animation: silver-glow 1.5s ease-in-out infinite;
}

@keyframes silver-glow {
  0%, 100% { filter: drop-shadow(0 0 4px #C0C0C0); }
  50% { filter: drop-shadow(0 0 7px #E8E8E8); }
}

.blackjack-card.glow-gold {
  animation: gold-glow 1.5s ease-in-out infinite;
}

@keyframes gold-glow {
  0%, 100% { filter: drop-shadow(0 0 4px #FFD700); }
  50% { filter: drop-shadow(0 0 7px #FFA500); }
}

.blackjack-score {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: #FFD700;
  background: rgba(180, 180, 180, 0.4);
  padding: 0.3rem 1rem;
  border-radius: 6px;
  border: 2px solid #B8860B;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
  text-align: center;
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
  min-width: 80px;
}

.blackjack-dealer-area .blackjack-score {
  top: -12%;
}

.blackjack-player-area .blackjack-score {
  bottom: -12%;
}

/* スコアハイライト（BET選択時） */
.blackjack-score.highlight,
.hp-score.highlight {
  animation: score-highlight 1.5s ease-in-out infinite;
  border-color: #FFD700;
  background: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 40px rgba(255, 215, 0, 0.4);
  z-index: 150;
}

/* HP親要素のz-index上昇（BET選択時） */
.blackjack-hp.highlight-parent {
  z-index: 150;
}

@keyframes score-highlight {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 40px rgba(255, 215, 0, 0.4);
    transform: translateX(-50%) scale(1);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 215, 0, 1), 0 0 60px rgba(255, 215, 0, 0.6);
    transform: translateX(-50%) scale(1.05);
  }
}

/* モバイル用スコアハイライト */
.hp-score.highlight {
  transform: scale(1);
  animation: score-highlight-mobile 1.5s ease-in-out infinite;
}

@keyframes score-highlight-mobile {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 40px rgba(255, 215, 0, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 215, 0, 1), 0 0 60px rgba(255, 215, 0, 0.6);
    transform: scale(1.05);
  }
}

/* アクションボタン */
.blackjack-actions {
  position: absolute;
  bottom: 5%;
  right: 2%;
}

/* ドローボタンラッパー */
.draw-btn-wrapper {
  position: relative;
  display: inline-block;
}

/* ドロー制限メッセージ */
.draw-limit-message {
  display: none;
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: #ff6666;
  font-size: clamp(0.6rem, 1.5vw, 0.8rem);
  font-weight: bold;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 2px solid #ff6666;
  white-space: nowrap;
  z-index: 10;
  text-align: center;
  box-shadow: 0 0 10px rgba(255, 100, 100, 0.5);
}

.draw-limit-message.show {
  display: block;
  animation: limit-message-appear 0.3s ease-out;
}

@keyframes limit-message-appear {
  0% {
    opacity: 0;
    transform: translateY(-50%) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
}

/* タイトルへ戻るボタン */
.exit-btn {
  position: absolute;
  top: 2%;
  right: 2%;
  width: clamp(32px, 5vw, 44px);
  height: clamp(32px, 5vw, 44px);
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.8);
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  cursor: pointer;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.exit-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.1);
}

/* 終了確認モーダル */
.exit-modal {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 250;
}

.exit-modal-content {
  background: linear-gradient(145deg, #2a2a3a 0%, #1a1a2a 100%);
  padding: 1.5rem 2rem;
  border-radius: 12px;
  border: 2px solid #FFD700;
  text-align: center;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.exit-modal-title {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: #fff;
  margin-bottom: 1.5rem;
  font-weight: bold;
}

.exit-modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.exit-btn-confirm {
  background: linear-gradient(145deg, #cc3333 0%, #991111 100%);
  border-color: #ff6666;
  color: #fff;
  padding: 0.6rem 1.5rem;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
}

.exit-btn-confirm:hover {
  background: linear-gradient(145deg, #dd4444 0%, #aa2222 100%);
}

.exit-btn-cancel {
  background: linear-gradient(145deg, #3a3a4a 0%, #2a2a3a 100%);
  border-color: #888;
  color: #fff;
  padding: 0.6rem 1.5rem;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
}

.exit-btn-cancel:hover {
  background: linear-gradient(145deg, #4a4a5a 0%, #3a3a4a 100%);
}

/* サイドキャラ画像 */
.side-char-container {
  position: absolute;
  right: 18%;
  top: 0;
  height: 100%;
  width: clamp(150px, 28vw, 280px);
  pointer-events: none;
  z-index: 35;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.side-char-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.side-char-wrapper-top {
  transform: scaleY(-1);
}

.side-char {
  width: 100%;
  height: auto;
  display: block;
}

.selected-char {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: auto;
}

.selected-char-enemy {
  animation: char-sway-enemy 3s ease-in-out infinite;
}

.selected-char-player {
  animation: char-sway-player 2.5s ease-in-out infinite;
}

@keyframes char-sway-player {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(calc(-50% + 8px)) translateY(-6px);
  }
}

@keyframes char-sway-enemy {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(calc(-50% - 6px)) translateY(8px);
  }
}

.blackjack-btn-attack {
  position: absolute;
  bottom: 100%;
  right: 0;
  width: clamp(72px, 13vw, 104px);
  height: clamp(72px, 13vw, 104px);
  border-radius: 50%;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: transform 0.1s;
}

.blackjack-btn-attack img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.blackjack-btn-attack:hover:not(:disabled) {
  transform: scale(1.05);
}

.blackjack-btn-attack:active:not(:disabled) {
  transform: scale(0.95);
}

.blackjack-btn-attack:disabled,
.blackjack-btn-draw:disabled {
  opacity: 0.4;
  cursor: default;
}

.blackjack-btn-draw {
  width: clamp(43px, 7.8vw, 62px);
  height: clamp(43px, 7.8vw, 62px);
  border-radius: 50%;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: transform 0.1s;
}

.blackjack-btn-draw img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.blackjack-btn-draw:hover:not(:disabled) {
  transform: scale(1.1);
}

.blackjack-btn-draw:active:not(:disabled) {
  transform: scale(0.95);
}

/* 結果表示 */
.blackjack-result {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.85);
  padding: 2rem 3rem;
  border-radius: 12px;
  border: 2px solid #FFD700;
}

.blackjack-result-text {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: #FFD700;
  font-weight: bold;
  text-align: center;
}

.blackjack-damage-text {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: #fff;
  text-align: center;
}

/* HP表示 */
.blackjack-hp-display {
  display: none;
}

.blackjack-hp {
  position: absolute;
  right: 18%;
  width: clamp(40px, 6vw, 55px);
  height: clamp(40px, 6vw, 55px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 45;
}

.hp-badge {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #2a2a3a 0%, #1a1a2a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(
    50% 0%,
    65% 10%,
    95% 10%,
    88% 45%,
    100% 50%,
    88% 60%,
    85% 75%,
    50% 100%,
    15% 75%,
    12% 60%,
    0% 50%,
    12% 45%,
    5% 10%,
    35% 10%
  );
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.hp-badge::before {
  content: '';
  position: absolute;
  inset: 3px;
  background: linear-gradient(145deg, #1a1a2a 0%, #0a0a15 100%);
  clip-path: polygon(
    50% 0%,
    65% 10%,
    95% 10%,
    88% 45%,
    100% 50%,
    88% 60%,
    85% 75%,
    50% 100%,
    15% 75%,
    12% 60%,
    0% 50%,
    12% 45%,
    5% 10%,
    35% 10%
  );
  z-index: -1;
}

.hp-badge::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(145deg, #FFD700 0%, #B8860B 50%, #FFD700 100%);
  clip-path: polygon(
    50% 0%,
    65% 10%,
    95% 10%,
    88% 45%,
    100% 50%,
    88% 60%,
    85% 75%,
    50% 100%,
    15% 75%,
    12% 60%,
    0% 50%,
    12% 45%,
    5% 10%,
    35% 10%
  );
  z-index: -2;
}

/* モバイル用スコア（デスクトップでは非表示） */
.hp-score {
  display: none;
}

.dealer-hp {
  top: 8%;
}

.player-hp {
  bottom: 11%;
}

.blackjack-hp .hp-value {
  color: #FFD700;
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  font-weight: bold;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
  z-index: 1;
}

/* ベット選択モーダル */
.blackjack-bet-modal {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  justify-content: flex-end;
  align-items: center;
  z-index: 100;
  padding-right: 2%;
}

.bet-modal-content {
  background: rgba(0, 0, 0, 0.85);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  border: 2px solid #FFD700;
  text-align: center;
}

.bet-modal-title {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: #FFD700;
  margin-bottom: 1rem;
  font-weight: bold;
}

.bet-modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  justify-content: center;
}

/* スマホ用バトル画面 */
@media (max-width: 768px) {
  /* ゲーム画面全体のレイアウト */
  .blackjack-game-screen {
    flex-direction: column;
    padding: 2%;
  }

  /* キャラを上下中央に配置 */
  .side-char-container {
    position: absolute;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    height: 100%;
    width: 40%;
    max-width: 160px;
    flex-direction: column;
    justify-content: space-between;
  }

  /* 敵キャラは上に */
  .side-char-wrapper-top {
    transform: scaleY(-1);
  }

  /* カードエリア - 中央に詰めて配置 */
  .blackjack-dealer-area {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -110%);
    width: 90%;
    height: auto;
    margin: 0;
    padding: 0;
  }

  .blackjack-player-area {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 10%);
    width: 90%;
    height: auto;
    margin: 0;
    padding: 0;
  }

  /* カードを3枚で折り返し */
  .blackjack-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    height: auto;
    gap: 8px;
  }

  .blackjack-card {
    height: auto;
    width: 22%;
  }

  .blackjack-card img {
    height: auto;
    width: 100%;
  }

  /* カードエリアのスコアは非表示 */
  .blackjack-dealer-area .blackjack-score,
  .blackjack-player-area .blackjack-score {
    display: none;
  }

  /* HPの近くにスコア表示 */
  .hp-score {
    display: block;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: #FFD700;
    background: rgba(180, 180, 180, 0.4);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #B8860B;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
    white-space: nowrap;
    text-shadow: 0 0 3px rgba(255, 215, 0, 0.5);
    min-width: 60px;
    text-align: center;
  }

  /* 敵のスコアはHPの下 */
  .dealer-hp .hp-score {
    top: 100%;
    margin-top: 12px;
  }

  /* 自分のスコアはHPの上 */
  .player-hp .hp-score {
    bottom: 100%;
    margin-bottom: 12px;
  }

  /* デッキ表示（モバイル用位置調整） */
  .blackjack-deck {
    display: block;
    height: 12%;
  }

  .dealer-deck {
    top: 3%;
    left: 3%;
  }

  .player-deck {
    bottom: 3%;
    left: 3%;
  }

  /* HP位置調整 - キャラ画像のすぐ横に */
  .dealer-hp {
    top: 5%;
    left: 50%;
    right: auto;
    transform: translateX(55px);
  }

  .player-hp {
    bottom: 5%;
    left: 50%;
    right: auto;
    transform: translateX(55px);
  }

  .hp-badge {
    width: clamp(35px, 10vw, 50px);
    height: clamp(35px, 10vw, 50px);
  }

  .hp-value {
    font-size: clamp(0.9rem, 4vw, 1.2rem);
  }

  /* ボタン配置調整 */
  .blackjack-actions {
    bottom: 5%;
    right: 3%;
  }

  .blackjack-btn-attack {
    width: clamp(50px, 14vw, 70px);
    height: clamp(50px, 14vw, 70px);
  }

  .blackjack-btn-draw {
    width: clamp(38px, 10vw, 55px);
    height: clamp(38px, 10vw, 55px);
  }

  /* モーダル調整 */
  .bet-modal-content {
    padding: 0.8rem 1rem;
  }

  .bet-modal-title {
    font-size: 0.9rem;
    white-space: nowrap;
    margin-bottom: 0.6rem;
  }

  .bet-btn {
    min-width: 40px;
    font-size: 0.9rem;
    padding: 0.3rem 0.6rem;
  }

  /* 結果表示 */
  .blackjack-result-text {
    font-size: clamp(1.2rem, 5vw, 1.8rem);
  }

  .blackjack-damage-text {
    font-size: clamp(0.8rem, 3vw, 1rem);
    white-space: nowrap;
  }
}

.bet-btn {
  min-width: 60px;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
}

/* ゲームオーバー */
.blackjack-gameover {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 2rem;
  z-index: 200;
}

.gameover-text {
  font-size: clamp(2rem, 6vw, 4rem);
  color: #FFD700;
  font-weight: bold;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* BUST表示 */
.bust-text {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: bold;
  color: #ff3333;
  text-shadow:
    0 0 20px rgba(255, 50, 50, 0.8),
    0 0 40px rgba(255, 50, 50, 0.5),
    3px 3px 0 #000,
    -3px -3px 0 #000,
    3px -3px 0 #000,
    -3px 3px 0 #000;
  z-index: 150;
  pointer-events: none;
  opacity: 0;
}

.bust-text.animate {
  animation: bust-text-show 1.2s ease-out forwards;
}

@keyframes bust-text-show {
  0% {
    transform: translate(-50%, -50%) scale(0) rotate(-10deg);
    opacity: 0;
  }
  30% {
    transform: translate(-50%, -50%) scale(1.3) rotate(5deg);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 1;
  }
  80% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.8) rotate(0deg);
    opacity: 0;
  }
}

/* BLACKJACK演出 */
.blackjack-announce {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: clamp(2.5rem, 10vw, 5rem);
  font-weight: bold;
  color: #FFD700;
  text-shadow:
    0 0 30px rgba(255, 215, 0, 1),
    0 0 60px rgba(255, 215, 0, 0.8),
    0 0 90px rgba(255, 215, 0, 0.5),
    4px 4px 0 #000,
    -4px -4px 0 #000,
    4px -4px 0 #000,
    -4px 4px 0 #000;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  letter-spacing: 0.1em;
}

.blackjack-announce.animate {
  animation: blackjack-announce-show 2s ease-out forwards;
}

@keyframes blackjack-announce-show {
  0% {
    transform: translate(-50%, -50%) scale(0) rotate(-15deg);
    opacity: 0;
  }
  20% {
    transform: translate(-50%, -50%) scale(1.5) rotate(5deg);
    opacity: 1;
  }
  35% {
    transform: translate(-50%, -50%) scale(1.2) rotate(-3deg);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.3) rotate(0deg);
    opacity: 1;
    text-shadow:
      0 0 50px rgba(255, 215, 0, 1),
      0 0 100px rgba(255, 215, 0, 0.8),
      0 0 150px rgba(255, 215, 0, 0.6),
      4px 4px 0 #000,
      -4px -4px 0 #000,
      4px -4px 0 #000,
      -4px 4px 0 #000;
  }
  75% {
    transform: translate(-50%, -50%) scale(1.2) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 0;
  }
}

/* カード爆発アニメーション */
.blackjack-card.card-explode {
  animation: card-explode 0.6s ease-out forwards;
}

.blackjack-card.card-explode-1 {
  animation: card-explode-1 0.6s ease-out forwards;
}

.blackjack-card.card-explode-2 {
  animation: card-explode-2 0.6s ease-out forwards;
}

.blackjack-card.card-explode-3 {
  animation: card-explode-3 0.6s ease-out forwards;
}

.blackjack-card.card-explode-4 {
  animation: card-explode-4 0.6s ease-out forwards;
}

.blackjack-card.card-explode-5 {
  animation: card-explode-5 0.6s ease-out forwards;
}

@keyframes card-explode-1 {
  0% {
    transform: scale(1) translate(0, 0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: scale(0.5) translate(-150px, -100px) rotate(-45deg);
    opacity: 0;
  }
}

@keyframes card-explode-2 {
  0% {
    transform: scale(1) translate(0, 0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: scale(0.5) translate(150px, -80px) rotate(60deg);
    opacity: 0;
  }
}

@keyframes card-explode-3 {
  0% {
    transform: scale(1) translate(0, 0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: scale(0.5) translate(-100px, 120px) rotate(-30deg);
    opacity: 0;
  }
}

@keyframes card-explode-4 {
  0% {
    transform: scale(1) translate(0, 0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: scale(0.5) translate(120px, 100px) rotate(45deg);
    opacity: 0;
  }
}

@keyframes card-explode-5 {
  0% {
    transform: scale(1) translate(0, 0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: scale(0.5) translate(0px, -130px) rotate(20deg);
    opacity: 0;
  }
}
