* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: #fff9e6; /* Màu nền vàng nhạt */
    color: #333;
    display: flex;
    flex-direction: column; /* Xếp dọc các phần tử */
    justify-content: space-between; /* Đẩy header lên nóc, footer xuống đáy */
    align-items: center;
    min-height: 100vh;
    text-align: center;
}

/* --- TRANG TRÍ HEADER & FOOTER --- */
header {
    background-color: #ff6b81;
    color: white;
    width: 100%;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border-bottom: 5px dashed #ff4757;
}

footer {
    background-color: #2d3436;
    color: white;
    width: 100%;
    padding: 15px;
    font-weight: bold;
    margin-top: 20px;
}

/* --- KHUNG TRÒ CHƠI --- */
.game-container {
    background-color: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    border: 5px dashed #ffb8c6;
    margin-top: 20px;
}

h1 {
    font-size: 2.5rem;
    color: #ff6b81;
    text-shadow: 2px 2px 0px #ffe0b2;
    margin-bottom: 10px;
}

/* --- TRANG TRÍ NÚT DẤU HỎI VÀ LUẬT CHƠI --- */
.instruction-tooltip {
    position: relative;
    display: inline-block;
    margin-bottom: 10px;
    cursor: pointer;
}

/* Nút dấu hỏi tròn xoe */
.question-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background-color: #ffb74d;
    color: white;
    font-size: 1.5rem;
    font-weight: 900;
    border-radius: 50%;
    box-shadow: 0 4px 0px #f57c00;
    transition: transform 0.2s;
}

.instruction-tooltip:hover .question-icon {
    transform: translateY(2px);
    box-shadow: 0 2px 0px #f57c00;
}

/* Bảng luật chơi */
.tooltip-text {
    visibility: hidden;
    width: 300px;
    background-color: #4dd0e1;
    color: #2d3436;
    text-align: left;
    border-radius: 15px;
    padding: 15px;
    position: absolute;
    z-index: 100;
    top: 120%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
    font-size: 1.05rem;
    border: 3px solid #00acc1;
    line-height: 1.5;
}

/* Mũi tên chỉ lên */
.tooltip-text::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -10px;
    border-width: 10px;
    border-style: solid;
    border-color: transparent transparent #00acc1 transparent;
}

.instruction-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* --- KHU VỰC VÒNG QUAY --- */
.wheel-wrapper {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 30px auto;
}

.arrow {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0; 
    height: 0; 
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 35px solid #d63031;
    z-index: 10;
}

canvas {
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: transform 4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* NÚT QUAY */
button {
    background-color: #00acc1;
    color: white;
    border: 3px solid #00838f;
    border-radius: 25px;
    padding: 12px 30px;
    font-size: 1.3rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 2px 5px 0px #00838f;
    transition: all 0.3s ease;
    margin-top: 20px;
}

button:hover {
    background-color: #00838f;
    transform: translateY(-3px);
    box-shadow: 2px 8px 0px #006064;
}

#result {
    margin-top: 25px;
    font-size: 1.6rem;
    color: #e84393;
}

.back-link {
    display: inline-block;
    margin-top: 20px;
    color: #ff6b81;
    text-decoration: none;
    font-weight: bold;
}

.back-link:hover {
    text-decoration: underline;
}