/* ============================================
   Traditional God Desk Style - 傳統神明桌風格
   ============================================ */

/* CSS Variables */
:root {
  /* Wood tones - 木質色調 */
  --wood-darkest: #3D1F0D;
  --wood-dark: #5D2906;
  --wood-main: #8B4513;
  --wood-light: #A0522D;
  --wood-highlight: #CD853F;
  
  /* Gold accents - 金色裝飾 */
  --gold-bright: #FFD700;
  --gold-main: #D4AF37;
  --gold-dark: #B8860B;
  --gold-shadow: #8B6914;
  
  /* Red ceremonial - 紅色系 */
  --red-deep: #8B0000;
  --red-main: #B22222;
  --red-bright: #DC143C;
  --red-light: #CD5C5C;
  
  /* Cloth/fabric - 布料 */
  --cloth-red: #C41E3A;
  --cloth-gold: #CFB53B;
  --cloth-pattern: #8B0000;
  
  /* Flame colors - 火焰 */
  --flame-core: #FFFFFF;
  --flame-inner: #FFD93D;
  --flame-outer: #FF6B35;
  --flame-glow: rgba(255, 150, 50, 0.6);
  
  /* Smoke - 煙霧 */
  --smoke-light: rgba(220, 220, 220, 0.7);
  --smoke-medium: rgba(180, 180, 180, 0.5);
  --smoke-dark: rgba(140, 140, 140, 0.3);
  
  /* Background - 背景 */
  --bg-darkest: #1A0F0A;
  --bg-dark: #2C1810;
  --bg-wall: #4A3728;
  --bg-wall-light: #5D4A3A;
  
  /* Shadows */
  --shadow-soft: rgba(0, 0, 0, 0.3);
  --shadow-medium: rgba(0, 0, 0, 0.5);
  --shadow-hard: rgba(0, 0, 0, 0.7);
}

/* Import traditional Chinese font */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+TC:wght@400;700;900&display=swap');

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

body {
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-darkest) 0%, var(--bg-dark) 100%);
  font-family: 'Noto Serif TC', 'PMingLiU', serif;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1rem;
  color: var(--gold-main);
}

#app {
  width: 100%;
  max-width: 450px;
  position: relative;
}

/* ============================================
   Main Shrine Container - 神明廳主體
   ============================================ */

/* Remove CRT effects, add wooden cabinet frame */
.crt-screen {
  background: linear-gradient(
    180deg,
    var(--bg-wall) 0%,
    var(--bg-wall-light) 50%,
    var(--bg-wall) 100%
  );
  border: 8px solid var(--wood-dark);
  border-radius: 4px;
  padding: 0;
  position: relative;
  
  /* Wood frame effect */
  box-shadow: 
    inset 0 0 20px var(--shadow-soft),
    0 8px 32px var(--shadow-hard),
    0 0 0 2px var(--wood-main),
    0 0 0 4px var(--wood-dark);
    
  /* Remove CRT animation */
  animation: none;
}

/* Remove scanlines */
.crt-screen::before {
  display: none;
}

/* Add wood grain texture overlay */
.crt-screen::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    repeating-linear-gradient(
      90deg,
      transparent 0px,
      transparent 2px,
      rgba(0, 0, 0, 0.03) 2px,
      rgba(0, 0, 0, 0.03) 4px
    );
  pointer-events: none;
  z-index: 1;
  border-radius: 2px;
}

/* Shrine area */
.shrine {
  position: relative;
  z-index: 2;
}

/* Wall background with wood paneling effect */
.shrine-wall {
  position: relative;
  background: 
    linear-gradient(
      180deg,
      var(--bg-wall-light) 0%,
      var(--bg-wall) 30%,
      var(--bg-wall) 70%,
      var(--wood-darkest) 100%
    );
  padding: 1.5rem 1rem 1rem;
  border-bottom: 4px solid var(--wood-dark);
  
  /* Wood panel lines */
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent 0px,
      transparent 60px,
      rgba(0, 0, 0, 0.1) 60px,
      rgba(0, 0, 0, 0.1) 62px
    );
}

/* ============================================
   Plaque - 匾額「佛光普照」
   ============================================ */
.plaque {
  background: linear-gradient(
    180deg,
    var(--red-bright) 0%,
    var(--red-main) 50%,
    var(--red-deep) 100%
  );
  border: 4px solid var(--gold-main);
  border-radius: 2px;
  padding: 0.5rem 1.5rem;
  margin: 0 auto 1rem;
  max-width: 200px;
  position: relative;
  
  /* Center the text */
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  
  /* Gold frame effect */
  box-shadow: 
    inset 0 1px 0 var(--gold-bright),
    inset 0 -1px 0 var(--gold-dark),
    0 4px 8px var(--shadow-medium),
    0 0 0 1px var(--gold-dark),
    0 0 0 3px var(--wood-dark),
    0 0 0 5px var(--gold-shadow);
}

/* Corner decorations */
.plaque::before,
.plaque::after {
  content: '◆';
  position: absolute;
  color: var(--gold-bright);
  font-size: 0.6rem;
  text-shadow: 0 1px 2px var(--shadow-medium);
}

.plaque::before {
  top: 2px;
  left: 6px;
}

.plaque::after {
  top: 2px;
  right: 6px;
}

.plaque-text {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--gold-bright);
  letter-spacing: 0.4rem;
  /* Offset the letter-spacing on the last character to center properly */
  margin-right: -0.4rem;
  text-shadow: 
    1px 1px 0 var(--gold-dark),
    2px 2px 4px var(--shadow-medium);
  font-family: 'Noto Serif TC', serif;
}

/* ============================================
   Couplets - 對聯
   ============================================ */
.couplet {
  position: absolute;
  top: 50px;
  width: 32px;
  padding: 0.6rem 0.4rem;
  background: linear-gradient(
    180deg,
    var(--red-bright) 0%,
    var(--red-main) 50%,
    var(--red-deep) 100%
  );
  border: 2px solid var(--gold-main);
  border-radius: 2px;
  
  /* Frame effect */
  box-shadow: 
    inset 0 1px 0 var(--gold-bright),
    0 4px 8px var(--shadow-medium),
    0 0 0 1px var(--gold-dark);
}

.couplet-left {
  left: 8px;
}

.couplet-right {
  right: 8px;
}

/* Top decoration */
.couplet::before {
  content: '◆';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gold-bright);
  font-size: 0.5rem;
  text-shadow: 0 1px 2px var(--shadow-medium);
}

/* Bottom tassel */
.couplet::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 12px solid var(--red-deep);
  filter: drop-shadow(0 2px 2px var(--shadow-soft));
}

.couplet-text {
  writing-mode: vertical-rl;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-bright);
  letter-spacing: 0.15rem;
  line-height: 1.4;
  text-shadow: 
    1px 1px 0 var(--gold-dark),
    1px 1px 3px var(--shadow-soft);
  font-family: 'Noto Serif TC', serif;
}

/* ============================================
   Ancestral Tablet - 神主牌
   ============================================ */
.tablet {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0.5rem;
}

/* Top decorative roof */
.tablet-top {
  width: 160px;
  height: 20px;
  background: linear-gradient(
    180deg,
    var(--gold-bright) 0%,
    var(--gold-main) 40%,
    var(--gold-dark) 100%
  );
  border-radius: 60% 60% 0 0 / 100% 100% 0 0;
  position: relative;
  box-shadow: 
    0 -2px 4px var(--shadow-soft),
    inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

/* Roof ridge decoration */
.tablet-top::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 12px;
  background: linear-gradient(
    180deg,
    var(--gold-bright) 0%,
    var(--gold-main) 100%
  );
  border-radius: 50% 50% 0 0;
  box-shadow: 0 -2px 4px var(--shadow-soft);
}

/* Side ornaments */
.tablet-top::after {
  content: '卍';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--red-main);
  font-size: 0.7rem;
  text-shadow: 0 1px 1px var(--shadow-soft);
}

/* Main tablet body */
.tablet-body {
  width: 150px;
  min-height: 160px;
  background: linear-gradient(
    90deg,
    var(--wood-dark) 0%,
    var(--wood-main) 15%,
    var(--wood-light) 50%,
    var(--wood-main) 85%,
    var(--wood-dark) 100%
  );
  border: 3px solid var(--gold-main);
  position: relative;
  
  box-shadow: 
    inset 0 0 20px var(--shadow-soft),
    0 4px 12px var(--shadow-medium),
    0 0 0 1px var(--gold-dark);
}

/* Inner frame decoration */
.tablet-body::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  border: 2px solid var(--gold-dark);
  background: linear-gradient(
    180deg,
    var(--wood-main) 0%,
    var(--wood-light) 50%,
    var(--wood-main) 100%
  );
  box-shadow: inset 0 0 10px var(--shadow-soft);
}

.tablet-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 1.2rem 0.8rem;
  text-align: center;
}

.tablet-header {
  font-size: 0.7rem;
  color: var(--gold-dark);
  letter-spacing: 0.1rem;
  margin-bottom: 0.3rem;
  font-family: 'Noto Serif TC', serif;
}

.tablet-surname {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--gold-bright);
  text-shadow:
    1px 1px 0 var(--gold-dark),
    2px 2px 4px var(--shadow-medium);
  line-height: 1.2;
  font-family: 'Noto Serif TC', serif;
  animation: none;
}

.tablet-main {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-main);
  writing-mode: vertical-rl;
  letter-spacing: 0.1rem;
  margin: 0.5rem 0;
  height: 60px;
  text-shadow: 1px 1px 2px var(--shadow-soft);
  font-family: 'Noto Serif TC', serif;
}

.tablet-footer {
  font-size: 0.7rem;
  color: var(--gold-dark);
  letter-spacing: 0.1rem;
  font-family: 'Noto Serif TC', serif;
}

/* Base/pedestal */
.tablet-base {
  width: 170px;
  height: 25px;
  background: linear-gradient(
    180deg,
    var(--gold-main) 0%,
    var(--gold-dark) 30%,
    var(--wood-dark) 50%,
    var(--wood-darkest) 100%
  );
  border-radius: 0 0 4px 4px;
  position: relative;
  box-shadow: 
    0 4px 8px var(--shadow-medium),
    inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.tablet-base::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 10%;
  right: 10%;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--gold-dark) 20%,
    var(--gold-main) 50%,
    var(--gold-dark) 80%,
    transparent 100%
  );
}

/* ============================================
   Altar Table - 神桌
   ============================================ */
.altar-table {
  position: relative;
  background: linear-gradient(
    180deg,
    var(--wood-main) 0%,
    var(--wood-dark) 100%
  );
  border-top: 3px solid var(--gold-dark);
  z-index: 2;
}

/* Table surface with offerings */
.table-surface {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1.5rem;
  padding: 1rem 1rem 0.5rem;
  background: linear-gradient(
    180deg,
    var(--wood-light) 0%,
    var(--wood-main) 100%
  );
  position: relative;
}

/* Wood grain on table surface */
.table-surface::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0px,
    transparent 30px,
    rgba(0, 0, 0, 0.05) 30px,
    rgba(0, 0, 0, 0.05) 31px
  );
  pointer-events: none;
}

/* ============================================
   Candle Holders - 燭台
   ============================================ */
.candle-holder {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.candle {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Realistic flame */
.flame {
  width: 10px;
  height: 20px;
  background: linear-gradient(
    180deg,
    var(--flame-core) 0%,
    var(--flame-inner) 30%,
    var(--flame-outer) 70%,
    transparent 100%
  );
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flame-flicker 0.5s ease-in-out infinite alternate;
  box-shadow:
    0 0 10px var(--flame-inner),
    0 0 20px var(--flame-outer),
    0 0 30px var(--flame-glow);
  position: relative;
  z-index: 2;
}

@keyframes flame-flicker {
  0% {
    transform: scaleY(1) scaleX(1) rotate(-2deg);
    opacity: 1;
  }
  50% {
    transform: scaleY(1.1) scaleX(0.9) rotate(1deg);
    opacity: 0.9;
  }
  100% {
    transform: scaleY(0.95) scaleX(1.05) rotate(2deg);
    opacity: 1;
  }
}

/* Candle body - red ceremonial candle */
.candle-body {
  width: 14px;
  height: 40px;
  background: linear-gradient(
    90deg,
    var(--red-deep) 0%,
    var(--red-main) 30%,
    var(--red-bright) 50%,
    var(--red-main) 70%,
    var(--red-deep) 100%
  );
  border-radius: 2px 2px 0 0;
  margin-top: -2px;
  box-shadow: 
    inset 0 0 5px var(--shadow-soft),
    2px 2px 4px var(--shadow-soft);
  position: relative;
}

/* Candle drip effect */
.candle-body::before {
  content: '';
  position: absolute;
  top: 0;
  left: -2px;
  width: 6px;
  height: 15px;
  background: linear-gradient(
    180deg,
    var(--red-bright) 0%,
    var(--red-main) 100%
  );
  border-radius: 0 0 50% 50%;
}

/* Candle stand - brass/gold */
.candle-stand {
  width: 30px;
  height: 20px;
  background: linear-gradient(
    180deg,
    var(--gold-bright) 0%,
    var(--gold-main) 40%,
    var(--gold-dark) 100%
  );
  border-radius: 2px;
  box-shadow: 
    0 2px 4px var(--shadow-medium),
    inset 0 1px 2px rgba(255, 255, 255, 0.3);
  position: relative;
}

.candle-stand::before {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 8px;
  background: linear-gradient(
    180deg,
    var(--gold-main) 0%,
    var(--gold-dark) 100%
  );
  border-radius: 2px;
}

/* ============================================
   Incense Burner - 香爐
   ============================================ */
.incense-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Incense sticks */
.incense-sticks {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 0px;
  position: relative;
  z-index: 2;
}

.incense-stick {
  width: 2px;
  height: 50px;
  background: linear-gradient(
    180deg,
    var(--gold-main) 0%,
    #8B7355 50%,
    #6B5344 100%
  );
  border-radius: 1px;
  position: relative;
  animation: none;
}

/* Glowing ember tip */
.incense-ember {
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: radial-gradient(
    circle,
    #FF6B35 0%,
    #FF4500 50%,
    #8B0000 100%
  );
  border-radius: 50%;
  animation: ember-glow 1s ease-in-out infinite alternate;
  box-shadow: 
    0 0 4px #FF6B35,
    0 0 8px #FF4500;
}

@keyframes ember-glow {
  0% {
    opacity: 0.8;
    box-shadow: 0 0 4px #FF6B35, 0 0 8px #FF4500;
  }
  100% {
    opacity: 1;
    box-shadow: 0 0 6px #FF6B35, 0 0 12px #FF4500;
  }
}

/* Smoke effect */
.smoke-container {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  pointer-events: none;
}

.smoke {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--smoke-light);
  border-radius: 50%;
  animation: smoke-rise 3s infinite ease-out;
  filter: blur(3px);
}

.smoke:nth-child(1) { left: 20px; animation-delay: 0s; }
.smoke:nth-child(2) { left: 26px; animation-delay: 1s; }
.smoke:nth-child(3) { left: 32px; animation-delay: 2s; }

@keyframes smoke-rise {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-25px) translateX(5px) scale(1.5);
    opacity: 0.4;
  }
  100% {
    transform: translateY(-50px) translateX(-5px) scale(2);
    opacity: 0;
  }
}

/* Incense burner - bronze tripod style */
.incense-burner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Burner ears/handles */
.burner-ear {
  display: block;
  position: absolute;
  top: 5px;
  width: 8px;
  height: 15px;
  background: linear-gradient(
    90deg,
    var(--gold-dark) 0%,
    var(--gold-main) 50%,
    var(--gold-dark) 100%
  );
  border-radius: 50%;
}

.burner-ear-left {
  left: -6px;
}

.burner-ear-right {
  right: -6px;
}

/* Main burner body */
.burner-body {
  width: 50px;
  height: 35px;
  background: linear-gradient(
    180deg,
    #CD7F32 0%,
    #B87333 30%,
    #8B5A2B 70%,
    #6B4423 100%
  );
  border-radius: 5px 5px 50% 50% / 5px 5px 30% 30%;
  box-shadow: 
    inset 0 5px 10px rgba(255, 255, 255, 0.2),
    inset 0 -5px 10px rgba(0, 0, 0, 0.3),
    0 4px 8px var(--shadow-medium);
  position: relative;
}

/* Decorative band */
.burner-body::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 5px;
  right: 5px;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--gold-dark) 0%,
    var(--gold-main) 50%,
    var(--gold-dark) 100%
  );
  border-radius: 2px;
}

/* Burner feet */
.burner-foot {
  display: flex;
  justify-content: space-between;
  width: 40px;
  margin-top: -2px;
}

.burner-foot::before,
.burner-foot::after {
  content: '';
  width: 10px;
  height: 10px;
  background: linear-gradient(
    180deg,
    #B87333 0%,
    #6B4423 100%
  );
  border-radius: 0 0 50% 50%;
}

/* ============================================
   Offerings Row - 供品列
   ============================================ */
.offerings {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(
    180deg,
    var(--wood-main) 0%,
    var(--wood-dark) 100%
  );
  border-top: 2px solid var(--wood-darkest);
}

/* Tea cups - 茶杯 */
.tea-set {
  display: flex;
  gap: 6px;
}

.tea-cup {
  width: 16px;
  height: 14px;
  background: linear-gradient(
    180deg,
    #FFFFFF 0%,
    #F5F5F5 50%,
    #E8E8E8 100%
  );
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  box-shadow: 
    inset 0 -3px 5px rgba(0, 0, 0, 0.1),
    0 2px 4px var(--shadow-soft);
  position: relative;
  border: 1px solid #DDD;
}

/* Tea inside cup */
.tea-cup::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  height: 4px;
  background: linear-gradient(
    180deg,
    #8B4513 0%,
    #654321 100%
  );
  border-radius: 50%;
  animation: none;
}

/* Fruit plate - 水果盤 */
.fruit-plate {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fruits {
  display: flex;
  gap: 2px;
  margin-bottom: -5px;
  position: relative;
  z-index: 1;
}

.fruit {
  font-size: 1rem;
  filter: drop-shadow(0 2px 2px var(--shadow-soft));
}

.plate {
  width: 50px;
  height: 12px;
  background: linear-gradient(
    180deg,
    #FFFFFF 0%,
    #F0F0F0 50%,
    #E0E0E0 100%
  );
  border-radius: 50%;
  box-shadow: 
    0 2px 4px var(--shadow-soft),
    inset 0 -2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid #DDD;
}

.plate::before {
  display: none;
}

/* Flower vases - 花瓶 */
.vase {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.flowers {
  font-size: 1.2rem;
  margin-bottom: -8px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 2px var(--shadow-soft));
}

.vase-body {
  width: 20px;
  height: 30px;
  background: linear-gradient(
    90deg,
    #4169E1 0%,
    #6495ED 30%,
    #87CEEB 50%,
    #6495ED 70%,
    #4169E1 100%
  );
  border-radius: 30% 30% 50% 50% / 20% 20% 50% 50%;
  box-shadow: 
    inset 0 0 10px rgba(255, 255, 255, 0.3),
    0 2px 4px var(--shadow-soft);
  position: relative;
}

/* Vase neck */
.vase-body::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 8px;
  background: linear-gradient(
    90deg,
    #4169E1 0%,
    #6495ED 50%,
    #4169E1 100%
  );
  border-radius: 2px 2px 0 0;
}

/* ============================================
   Table Front - 桌面與桌裙
   ============================================ */
.table-top {
  height: 8px;
  background: linear-gradient(
    180deg,
    var(--wood-highlight) 0%,
    var(--wood-main) 50%,
    var(--wood-dark) 100%
  );
  box-shadow: 
    0 2px 4px var(--shadow-soft),
    inset 0 1px 2px rgba(255, 255, 255, 0.2);
  position: relative;
}

/* Carved edge decoration */
.table-top::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 3px;
  background: repeating-linear-gradient(
    90deg,
    var(--gold-dark) 0px,
    var(--gold-main) 5px,
    var(--gold-dark) 10px
  );
}

.table-front {
  height: 60px;
  background: linear-gradient(
    180deg,
    var(--cloth-red) 0%,
    var(--red-main) 50%,
    var(--red-deep) 100%
  );
  position: relative;
  box-shadow: 
    inset 0 5px 15px rgba(0, 0, 0, 0.3),
    0 4px 8px var(--shadow-medium);
  overflow: hidden;
}

/* Embroidered pattern overlay */
.table-cloth {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    /* Dragon/phoenix pattern simulation */
    radial-gradient(
      ellipse 30px 20px at 25% 50%,
      var(--cloth-gold) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse 30px 20px at 75% 50%,
      var(--cloth-gold) 0%,
      transparent 50%
    ),
    /* Center medallion */
    radial-gradient(
      circle at 50% 50%,
      var(--cloth-gold) 0%,
      transparent 15%
    );
  opacity: 0.3;
}

/* Gold border trim */
.table-cloth::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 5%;
  right: 5%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--gold-main) 10%,
    var(--gold-bright) 50%,
    var(--gold-main) 90%,
    transparent 100%
  );
}

.table-cloth::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 5%;
  right: 5%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--gold-main) 10%,
    var(--gold-bright) 50%,
    var(--gold-main) 90%,
    transparent 100%
  );
}

/* Fringe at bottom */
.table-front::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    var(--gold-main) 0px,
    var(--gold-main) 3px,
    transparent 3px,
    transparent 6px
  );
}

/* ============================================
   Divination Section - 擲筊區域
   ============================================ */
.divination-section {
  padding: 1.5rem 1rem;
  text-align: center;
  background: linear-gradient(
    180deg,
    var(--bg-wall) 0%,
    var(--bg-dark) 100%
  );
  border-top: 4px solid var(--wood-dark);
}

/* Divination blocks container */
.divination-blocks {
  display: flex;
  gap: 3rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  min-height: 60px;
}

/* Individual block - wooden crescent moon shape */
.block {
  width: 55px;
  height: 55px;
  position: relative;
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Flat side (陽面) - shows when result is flat */
.block-flat-side {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    var(--wood-highlight) 0%,
    var(--wood-main) 50%,
    var(--wood-dark) 100%
  );
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  box-shadow: 
    inset 0 -5px 15px rgba(0, 0, 0, 0.3),
    inset 0 5px 10px rgba(255, 255, 255, 0.2),
    0 4px 8px var(--shadow-medium);
  display: flex;
  align-items: center;
  justify-content: center;
}

.block-flat-side::before {
  content: '陽';
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold-main);
  text-shadow: 1px 1px 2px var(--shadow-soft);
  font-family: 'Noto Serif TC', serif;
}

/* Curved side (陰面) - shows when result is curved */
.block-curved-side {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    var(--wood-dark) 0%,
    var(--wood-darkest) 50%,
    #2A1A10 100%
  );
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  box-shadow: 
    inset 0 5px 15px rgba(0, 0, 0, 0.5),
    inset 0 -3px 8px rgba(255, 255, 255, 0.1),
    0 4px 8px var(--shadow-medium);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.block-curved-side::before {
  content: '陰';
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--wood-highlight);
  text-shadow: 1px 1px 2px var(--shadow-hard);
  font-family: 'Noto Serif TC', serif;
}

/* Flat state */
.block.flat .block-flat-side {
  opacity: 1;
}

.block.flat .block-curved-side {
  opacity: 0;
}

/* Curved state */
.block.curved .block-flat-side {
  opacity: 0;
}

.block.curved .block-curved-side {
  opacity: 1;
}

/* Throwing animation */
.block.throwing {
  animation: block-throw 0.8s ease-in-out;
}

@keyframes block-throw {
  0% {
    transform: translateY(0) rotateX(0) rotateY(0);
  }
  25% {
    transform: translateY(-30px) rotateX(180deg) rotateY(90deg);
  }
  50% {
    transform: translateY(-40px) rotateX(360deg) rotateY(180deg);
  }
  75% {
    transform: translateY(-20px) rotateX(540deg) rotateY(270deg);
  }
  100% {
    transform: translateY(0) rotateX(720deg) rotateY(360deg);
  }
}

/* Result display */
.result {
  font-size: 1.6rem;
  font-weight: 700;
  min-height: 2.5rem;
  margin-bottom: 1.5rem;
  font-family: 'Noto Serif TC', serif;
}

.result.sheng-jiao {
  color: var(--red-bright);
  text-shadow: 
    0 0 10px rgba(220, 20, 60, 0.6),
    2px 2px 4px var(--shadow-soft);
  animation: result-appear 0.5s ease-out;
}

.result.xiao-jiao {
  color: var(--gold-bright);
  text-shadow: 
    0 0 10px rgba(255, 215, 0, 0.6),
    2px 2px 4px var(--shadow-soft);
  animation: result-appear 0.5s ease-out;
}

.result.yin-jiao {
  color: var(--wood-highlight);
  text-shadow: 
    0 0 10px rgba(205, 133, 63, 0.6),
    2px 2px 4px var(--shadow-soft);
  animation: result-appear 0.5s ease-out;
}

@keyframes result-appear {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Throw button */
.throw-btn {
  padding: 0.8rem 2.5rem;
  font-size: 1.2rem;
  font-family: 'Noto Serif TC', serif;
  font-weight: 700;
  background: linear-gradient(
    180deg,
    var(--red-bright) 0%,
    var(--red-main) 50%,
    var(--red-deep) 100%
  );
  border: 3px solid var(--gold-main);
  border-radius: 4px;
  color: var(--gold-bright);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 
    0 4px 8px var(--shadow-medium),
    inset 0 1px 2px rgba(255, 255, 255, 0.2),
    0 0 0 1px var(--gold-dark);
  position: relative;
  overflow: hidden;
}

.throw-btn:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 6px 12px var(--shadow-medium),
    inset 0 1px 2px rgba(255, 255, 255, 0.3),
    0 0 15px rgba(255, 215, 0, 0.3);
}

.throw-btn:active {
  transform: translateY(0);
  box-shadow: 
    0 2px 4px var(--shadow-medium),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.throw-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ============================================
   Settings Section - 設定區
   ============================================ */
.settings {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  margin-top: 0;
  background: linear-gradient(
    180deg,
    var(--wood-dark) 0%,
    var(--wood-darkest) 100%
  );
  border: 2px solid var(--wood-main);
  border-radius: 0 0 4px 4px;
}

.settings label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.label-text {
  color: var(--gold-main);
  font-family: 'Noto Serif TC', serif;
}

.settings input {
  width: 70px;
  padding: 0.5rem;
  font-size: 1.1rem;
  text-align: center;
  background: linear-gradient(
    180deg,
    #FFF8DC 0%,
    #F5DEB3 100%
  );
  border: 2px solid var(--gold-dark);
  border-radius: 2px;
  color: var(--wood-darkest);
  font-family: 'Noto Serif TC', serif;
  font-weight: 700;
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.settings input:focus {
  outline: none;
  border-color: var(--gold-bright);
  box-shadow: 
    inset 0 2px 4px rgba(0, 0, 0, 0.1),
    0 0 8px rgba(255, 215, 0, 0.4);
}

.settings input::placeholder {
  color: var(--wood-light);
}

#save-btn {
  padding: 0.5rem 1.2rem;
  font-size: 0.9rem;
  font-family: 'Noto Serif TC', serif;
  font-weight: 700;
  background: linear-gradient(
    180deg,
    var(--gold-bright) 0%,
    var(--gold-main) 50%,
    var(--gold-dark) 100%
  );
  border: 2px solid var(--gold-dark);
  border-radius: 2px;
  color: var(--wood-darkest);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px var(--shadow-soft);
}

#save-btn:hover {
  transform: translateY(-1px);
  box-shadow: 
    0 4px 8px var(--shadow-soft),
    0 0 10px rgba(255, 215, 0, 0.3);
}

#save-btn:active {
  transform: translateY(0);
}

/* ============================================
   Responsive Design - 響應式設計
   ============================================ */
@media (max-width: 400px) {
  body {
    padding: 0.5rem;
  }

  .crt-screen {
    border-width: 6px;
  }

  .shrine-wall {
    padding: 1rem 0.8rem 0.8rem;
  }

  .plaque {
    padding: 0.4rem 1rem;
    max-width: 160px;
  }

  .plaque-text {
    font-size: 1rem;
    letter-spacing: 0.2rem;
  }

  .couplet {
    width: 26px;
    padding: 0.4rem 0.3rem;
  }

  .couplet-text {
    font-size: 0.65rem;
  }

  .tablet-top {
    width: 130px;
  }

  .tablet-body {
    width: 120px;
    min-height: 130px;
  }

  .tablet-base {
    width: 140px;
  }

  .tablet-surname {
    font-size: 1.8rem;
  }

  .tablet-main {
    font-size: 0.65rem;
    height: 50px;
  }

  .table-surface {
    gap: 1rem;
    padding: 0.8rem 0.8rem 0.4rem;
  }

  .candle-body {
    height: 30px;
  }

  .incense-stick {
    height: 40px;
  }

  .divination-blocks {
    gap: 2rem;
  }

  .block {
    width: 45px;
    height: 45px;
  }

  .block-flat-side::before,
  .block-curved-side::before {
    font-size: 1rem;
  }

  .result {
    font-size: 1.3rem;
  }

  .throw-btn {
    padding: 0.6rem 2rem;
    font-size: 1rem;
  }

  .settings {
    flex-direction: column;
    gap: 0.8rem;
  }
}

@media (max-width: 320px) {
  .plaque {
    max-width: 140px;
  }

  .plaque-text {
    font-size: 0.9rem;
    letter-spacing: 0.15rem;
  }

  .couplet {
    display: none;
  }

  .tablet-top {
    width: 110px;
  }

  .tablet-body {
    width: 100px;
    min-height: 110px;
  }

  .tablet-base {
    width: 120px;
  }

  .tablet-surname {
    font-size: 1.5rem;
  }

  .block {
    width: 40px;
    height: 40px;
  }
}

/* ============================================
   Remove CRT-specific effects
   ============================================ */

/* Remove old CRT animations */
@keyframes crt-flicker {
  0%, 100% { opacity: 1; }
}

@keyframes text-glow {
  0%, 100% { text-shadow: none; }
}

/* Keep power-on effect but make it subtle */
@keyframes power-on {
  0% {
    opacity: 0;
    transform: scale(0.98);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.crt-screen.power-on {
  animation: power-on 0.5s ease-out;
}

/* Subtle screen flash for interactions */
@keyframes screen-flash {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.1); }
  100% { filter: brightness(1); }
}

.crt-screen.flashing {
  animation: screen-flash 0.15s ease-out;
}

/* Remove glitch effect, replace with gentle shake */
@keyframes gentle-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

.glitch-effect {
  animation: gentle-shake 0.2s ease-in-out;
}
