@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
  --primary: #222222;
  --primary-hover: #333333;
  --secondary: #444444;
  --bg-dark: #0a0a0a;
  --bg-input: #171717;
  --bg-card: #1f1f1f;
  --text-white: #ffffff;
  --text-muted: #94a3b8;
  --border: #262626;
  --accent: #ffffff;
  --pointer-color: #ffffff;
  --shadow: 0 4px 30px rgba(0, 0, 0, 0.7);
  --font-family: 'Outfit', sans-serif;
  --accent-glow: rgba(255, 255, 255, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent !important;
  outline: none !important;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-white);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-top: 60px;
}

.bg-blob {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
  z-index: -1;
  filter: blur(100px);
}

.blob-1 {
  top: -10%;
  left: -20%;
}

.blob-2 {
  bottom: -20%;
  right: -20%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
}

.tabs-container {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 1rem 1rem 0;
  background: #222222;
  border-bottom: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
}

.tabs-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  align-items: flex-end;
  padding-bottom: 0px;
}

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

.tab-item {
  padding: 0 1.2rem;
  height: 40px;
  background: #222222;
  color: white;
  border: none;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  opacity: 0.6;
  transition: opacity 0.2s, background 0.2s;
  position: relative;
  top: 1px;
  border-bottom: 1px solid #000;
}

.tab-item.active {
  opacity: 1;
  background: var(--bg-dark);
  z-index: 10;
  border-bottom: 1px solid var(--bg-dark);
}

.tab-item:hover:not(.active) {
  opacity: 0.8;
}

#app {
  width: 100%;
  max-width: 90vw;
  padding: 2rem;
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
}

.generator-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 32px;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
  width: max-content;
  min-width: 400px;
  max-width: 100%;
}

.result-display {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  padding: 0 2rem;
}

#random-result,
#dice-result {
  font-size: 6rem;
  font-weight: 700;
  background: linear-gradient(180deg, #fff 0%, #aaa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
}

.inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.input-field {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.input-field label {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.input-field input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem;
  color: white;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 600;
  width: 100%;
  transition: all 0.2s;
  text-align: center;
}

.input-field input:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.generate-btn {
  background: #222222;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  height: 64px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.generate-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.02);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.generate-btn:active {
  transform: scale(0.98);
}

#view-dice .generator-card {
  background: transparent;
  border: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

.dice-display {
  perspective: 1000px;
  background: transparent !important;
  border: none !important;
  overflow: visible !important;
  height: 260px !important;
  margin-bottom: 2rem;
}

.dice-scene {
  width: 160px;
  height: 160px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cube {
  width: 160px;
  height: 160px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1.2s cubic-bezier(0.1, 0.7, 0.3, 1);
}

.cube-face {
  position: absolute;
  width: 162px;
  height: 162px;
  background: white;
  border: 4px solid #ddd;
  border-radius: 20px;
  padding: 10px;
  backface-visibility: hidden;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.1);
  margin-top: -1px;
  margin-left: -1px;
}

.front {
  transform: rotateY(0deg) translateZ(80px);
}

.back {
  transform: rotateY(180deg) translateZ(80px);
}

.right {
  transform: rotateY(90deg) translateZ(80px);
}

.left {
  transform: rotateY(-90deg) translateZ(80px);
}

.top {
  transform: rotateX(90deg) translateZ(80px);
}

.bottom {
  transform: rotateX(-90deg) translateZ(80px);
}

.cube-face::before {
  content: '';
  width: 24px;
  height: 24px;
  background: black;
  border-radius: 50%;
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

[data-value="1"]::before {
  display: block;
}

[data-value="2"]::before {
  display: block;
  background: transparent;
  box-shadow: -40px -40px 0 black, 40px 40px 0 black;
}

[data-value="3"]::before {
  display: block;
  box-shadow: -40px -40px 0 black, 40px 40px 0 black;
}

[data-value="4"]::before {
  display: block;
  background: transparent;
  box-shadow: -40px -40px 0 black, 40px -40px 0 black, -40px 40px 0 black, 40px 40px 0 black;
}

[data-value="5"]::before {
  display: block;
  box-shadow: -40px -40px 0 black, 40px -40px 0 black, -40px 40px 0 black, 40px 40px 0 black;
}

[data-value="6"]::before {
  display: block;
  background: transparent;
  box-shadow: -40px -40px 0 black, 40px -40px 0 black, -40px 0 0 black, 40px 0 0 black, -40px 40px 0 black, 40px 40px 0 black;
}

.show-1 {
  transform: rotateX(0deg) rotateY(0deg);
}

.show-2 {
  transform: rotateX(90deg) rotateY(0deg);
}

.show-3 {
  transform: rotateX(0deg) rotateY(-90deg);
}

.show-4 {
  transform: rotateX(0deg) rotateY(90deg);
}

.show-5 {
  transform: rotateX(-90deg) rotateY(0deg);
}

.show-6 {
  transform: rotateX(-180deg) rotateY(0deg);
}

.cube.rolling {
  animation: dice-roll 0.4s infinite linear;
}

@keyframes dice-roll {
  0% {
    transform: rotateX(0) rotateY(0) rotateZ(0);
  }

  100% {
    transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
  }
}

.dice-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
}

.dice-opt {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  height: 48px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
  font-family: inherit;
}

.dice-opt:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dice-opt.active {
  background: white;
  color: black;
  border-color: white;
}

.hidden {
  display: none !important;
}

@media (max-width: 480px) {
  #app {
    padding: 1rem;
  }

  .generator-card {
    padding: 2rem;
  }

  #random-result,
  #dice-result {
    font-size: 4rem;
  }
}

@media (prefers-color-scheme: light) {
  :root {
    --primary: #f5f5f5;
    --primary-hover: #eeeeee;
    --secondary: #e0e0e0;
    --bg-dark: #ffffff;
    --bg-input: #f5f5f5;
    --bg-card: #f5f5f5;
    --text-white: #000000;
    --text-muted: #666666;
    --border: #dddddd;
    --pointer-color: #000000;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  }

  .bg-blob {
    background: radial-gradient(circle, rgba(0, 0, 0, 0.03) 0%, transparent 70%);
  }

  .tabs-container {
    background: #e0e0e0 !important;
    border-bottom: none !important;
  }

  .tab-item {
    background: #e0e0e0 !important;
    color: #444444 !important;
    opacity: 0.8;
    border-bottom: 1px solid #ccc !important;
  }

  .tab-item.active {
    background: #ffffff !important;
    color: #000000 !important;
    border-bottom: 1px solid #ffffff !important;
    opacity: 1;
  }

  .generator-card {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.05);
  }

  .result-display {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
  }

  #random-result,
  #dice-result {
    background: linear-gradient(180deg, #000 0%, #444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
  }

  .input-field input {
    background: #ffffff;
    border: 1px solid #dddddd;
    color: #000000;
  }

  .input-field input:focus {
    background: #ffffff;
    border-color: #000000;
  }

  .generate-btn {
    background: #000000 !important;
    color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
  }

  .generate-btn:hover {
    background: #333333 !important;
    color: #ffffff !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  }

  .dice-opt {
    background: #000000 !important;
    color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
  }

  .dice-opt:hover {
    background: #333333 !important;
  }

  .dice-opt.active {
    background: #ffffff !important;
    color: #000000 !important;
    border-color: #000000 !important;
  }

  .cube-face {
    background: #000000 !important;
    border: 4px solid #222222 !important;
    box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.1) !important;
  }

  .cube-face::before {
    background: #ffffff !important;
  }

  [data-value="2"]::before,
  [data-value="4"]::before,
  [data-value="6"]::before {
    background: transparent !important;
  }

  [data-value="2"]::before {
    box-shadow: -40px -40px 0 #ffffff, 40px 40px 0 #ffffff !important;
  }

  [data-value="3"]::before {
    box-shadow: -40px -40px 0 #ffffff, 40px 40px 0 #ffffff !important;
  }

  [data-value="4"]::before {
    box-shadow: -40px -40px 0 #ffffff, 40px -40px 0 #ffffff, -40px 40px 0 #ffffff, 40px 40px 0 #ffffff !important;
  }

  [data-value="5"]::before {
    box-shadow: -40px -40px 0 #ffffff, 40px -40px 0 #ffffff, -40px 40px 0 #ffffff, 40px 40px 0 #ffffff !important;
  }

  [data-value="6"]::before {
    box-shadow: -40px -40px 0 #ffffff, 40px -40px 0 #ffffff, -40px 0 0 #ffffff, 40px 0 0 #ffffff, -40px 40px 0 #ffffff, 40px 40px 0 #ffffff !important;
  }
}